Registers support of certain features for a post type.
Description
All core features are directly associated with a functional area of the edit screen, such as the editor or a meta box. Features include: 'title', 'editor', 'comments', 'revisions', 'trackbacks', 'author', 'excerpt', 'page-attributes', 'thumbnail', 'custom-fields', and 'post-formats'. Additionally, the 'revisions' feature dictates whether the post type will store revisions, the 'autosave' feature dictates whether the post type will be autosaved, and the 'comments' feature dictates whether the comments count will show on the edit screen. A third, optional parameter can also be passed along with a feature to provide additional information about supporting that feature. Example usage: add_post_type_support( 'my_post_type', 'comments' );
add_post_type_support( 'my_post_type', array(
'author', 'excerpt',
) );
add_post_type_support( 'my_post_type', 'my_feature', array(
'field' => 'value',
) );
Parameters
$post_typestring
The post type for which to add the feature.
$featurestring|array
The feature being added, accepts an array of feature strings or a single string.
$argsmixed
Optional extra arguments to pass along with certain features.
Signature, return type and hooks compared across 5 parsed releases.
5.3.0
Formalized the existing and already documented ...$args parameter by adding it to the function signature.from the docblock
3.0.0
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/post.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.