default_category_post_types
Filters post types (in addition to 'post') that require a default category.
Usage
add_filter( 'default_category_post_types', 'wp_kama_default_category_post_types_filter' ); /** * Function for `default_category_post_types` filter-hook. * * @param string[] $post_types An array of post type names. * * @return string[] */ function wp_kama_default_category_post_types_filter( $post_types ){ // filter... return $post_types; }
- $post_types(string[])
- An array of post type names.
Default: empty array
Changelog
Since 5.5.0 | Introduced. |
Where the hook is called
default_category_post_types
wp-includes/post.php 5469
$default_category_post_types = apply_filters( 'default_category_post_types', array() );