default_category_post_types WordPress Filter Hook

The default_category_post_types hook is used to specify which post types should be included in the default category taxonomy. This hook is used in the following way: add_filter( 'default_category_post_types', 'my_default_category_post_types' ); function my_default_category_post_types( $post_types ) { // Add your post types here return $post_types; } In the example above, the my_default_category_post_types function is used to add one or more post types to the default category taxonomy. This function accepts an array of post types as its only argument and returns the modified array.

apply_filters( 'default_category_post_types', string[] $post_types ) #

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


Parameters

$post_types

(string[])An array of post type names. Default empty array.


Top ↑

Source

File: wp-includes/post.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More