post_types_to_delete_with_user
Filters the list of post types to delete with a user.
Usage
add_filter( 'post_types_to_delete_with_user', 'wp_kama_post_types_to_delete_with_user_filter', 10, 2 ); /** * Function for `post_types_to_delete_with_user` filter-hook. * * @param string[] $post_types_to_delete Array of post types to delete. * @param int $id User ID. * * @return string[] */ function wp_kama_post_types_to_delete_with_user_filter( $post_types_to_delete, $id ){ // filter... return $post_types_to_delete; }
- $post_types_to_delete(string[])
- Array of post types to delete.
- $id(int)
- User ID.
Changelog
Since 3.4.0 | Introduced. |
Where the hook is called
wp-admin/includes/user.php 400
$post_types_to_delete = apply_filters( 'post_types_to_delete_with_user', $post_types_to_delete, $id );