default_category_post_types filter-hookWP 5.5.0

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

wp_set_post_categories()
default_category_post_types
wp-includes/post.php 5251
$default_category_post_types = apply_filters( 'default_category_post_types', array() );

Where the hook is used in WordPress

Usage not found.