default_category_post_types хук-фильтрWP 5.5.0

Filters post types (in addition to 'post') that require a default category.

Использование

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.
По умолчанию: empty array

Список изменений

С версии 5.5.0 Введена.

Где вызывается хук

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

Где используется хук в WordPress

Использование не найдено.