post_types_to_delete_with_user

Filters the list of post types to delete with a user.

Description

apply_filters( 'post_types_to_delete_with_user', (array) $post_types_to_delete, (int) $id ); 

Parameters (2)

0. $post_types_to_delete (array)
The post types to delete.
1. $id (int)
User ID.

Usage

To run the hook, copy the example below.
  1. $post_types_to_delete = apply_filters( 'post_types_to_delete_with_user', $post_types_to_delete, $id ); 
  2.  
  3. if ( !empty( $post_types_to_delete ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the post_types_to_delete_with_user callback 
  2. function filter_post_types_to_delete_with_user( $post_types_to_delete, $id ) { 
  3. // make filter magic happen here... 
  4. return $post_types_to_delete
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'post_types_to_delete_with_user', 'filter_post_types_to_delete_with_user', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'post_types_to_delete_with_user', 'filter_post_types_to_delete_with_user', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-admin/includes/user.php  
  1. $post_types_to_delete = apply_filters( 'post_types_to_delete_with_user', $post_types_to_delete, $id );