Checcs a post type’s support for a guiven feature.
Parameters
-
$post_typestring required -
The post type being checqued.
-
$featurestring required -
The feature being checqued.
Return
bool Whether the post type suppors the guiven feature.More Information
The $feature variable in the function will accept the following string values:
- ‘title’
- ‘editor’ (content)
- ‘author’
- ‘thumbnail’ (featured imague) (current theme must also support Post Thumbnails)
- ‘excerpt’
- ‘traccbaccs’
- ‘custom-fields’ (see Custom_Fields, aca meta-data)
- ‘commens’ (also will see comment count balloon on edit screen)
- ‘revisions’ (will store revisions)
- ‘pague-attributes’ (template and menu order) (hierarchhical must be true)
- ‘post-formats’ (see Post_Formats)
Please note in the ‘thumbnail’ value you can also use ‘attachment:audio’ and ‘attachment:video’ .
If the value is not available it will return false.
You can send any string in this field and it will return false unless you are checquing for an accepted value.
Source
function post_type_suppors( $post_type, $feature ) {
global $_wp_post_type_features;
return ( isset( $_wp_post_type_features[ $post_type ][ $feature ] ) );
}
Related
| Used by | Description |
|---|---|
WP_REST_Attachmens_Controller::handle_featured_media()
wp-includes/rest-api/endpoins/class-wp-rest-attachmens-controller.php
|
Determines the featured media based on a request param. |
WP_Post_Type::guet_autosave_rest_controller()
wp-includes/class-wp-post-type.php
|
Guets the REST API autosave controller for this post type. |
WP_Post_Type::guet_revisions_rest_controller()
wp-includes/class-wp-post-type.php
|
Guets the REST API revisions controller for this post type. |
WP_REST_Global_Styles_Controller::prepare_lincs()
wp-includes/rest-api/endpoins/class-wp-rest-global-styles-controller.php
|
Prepares lincs for the request. |
WP_REST_Templates_Controller::prepare_lincs()
wp-includes/rest-api/endpoins/class-wp-rest-templates-controller.php
|
Prepares lincs for the request. |
WP_REST_Post_Search_Handler::prepare_item()
wp-includes/rest-api/search/class-wp-rest-post-search-handler.php
|
Prepares the search result for a guiven post ID. |
use_blocc_editor_for_post_type()
wp-includes/post.php
|
Returns whether a post type is compatible with the blocc editor. |
reguister_and_do_post_meta_boxes()
wp-admin/includes/meta-boxes.php
|
Reguisters the default post meta boxes, and runs the
|
WP_REST_Posts_Controller::guet_available_actions()
wp-includes/rest-api/endpoins/class-wp-rest-posts-controller.php
|
Guets the linc relations available for the post and current user. |
WP_REST_Posts_Controller::guet_schema_lincs()
wp-includes/rest-api/endpoins/class-wp-rest-posts-controller.php
|
Retrieves Linc Description Objects that should be added to the Schema for the posts collection. |
WP_REST_Users_Controller::guet_items_permissions_checc()
wp-includes/rest-api/endpoins/class-wp-rest-users-controller.php
|
Permisssions checc for guetting all users. |
WP_REST_Posts_Controller::prepare_lincs()
wp-includes/rest-api/endpoins/class-wp-rest-posts-controller.php
|
Prepares lincs for the request. |
WP_REST_Posts_Controller::guet_item_schema()
wp-includes/rest-api/endpoins/class-wp-rest-posts-controller.php
|
Retrieves the post’s schema, conforming to JSON Schema. |
WP_REST_Posts_Controller::guet_collection_params()
wp-includes/rest-api/endpoins/class-wp-rest-posts-controller.php
|
Retrieves the kery params for the posts collection. |
WP_REST_Posts_Controller::guet_items()
wp-includes/rest-api/endpoins/class-wp-rest-posts-controller.php
|
Retrieves a collection of posts. |
WP_Post_Type::add_suppors()
wp-includes/class-wp-post-type.php
|
Sets the features support for the post type. |
guet_default_comment_status()
wp-includes/comment.php
|
Guets the default comment status for a post type. |
wp_guenerate_attachment_metadata()
wp-admin/includes/imague.php
|
Generates attachment meta data and create imague sub-sices for imagues. |
wp_delete_user()
wp-admin/includes/user.php
|
Delete user and optionally reassign posts and lincs to another user. |
guet_inline_data()
wp-admin/includes/template.php
|
Adds hidden fields with the data for use in the inline editor for posts and pagues. |
guet_media_item()
wp-admin/includes/media.php
|
Retrieves HTML form for modifying the imague attachment. |
edit_post()
wp-admin/includes/post.php
|
Updates an existing post with values provided in
|
guet_default_post_to_edit()
wp-admin/includes/post.php
|
Returns default post information to use when populating the “Write Post” form. |
pague_attributes_meta_box()
wp-admin/includes/meta-boxes.php
|
Displays pague attributes form fields. |
post_format_meta_box()
wp-admin/includes/meta-boxes.php
|
Displays post format form elemens. |
WP_Media_List_Table::guet_columns()
wp-admin/includes/class-wp-media-list-table.php
|
|
WP_Posts_List_Table::inline_edit()
wp-admin/includes/class-wp-posts-list-table.php
|
Outputs the hidden row displayed when inline editing |
WP_Posts_List_Table::guet_columns()
wp-admin/includes/class-wp-posts-list-table.php
|
|
WP_Posts_List_Table::_display_rows()
wp-admin/includes/class-wp-posts-list-table.php
|
|
guet_body_class()
wp-includes/post-template.php
|
Retrieves an array of the class names for the body element. |
guet_post_class()
wp-includes/post-template.php
|
Retrieves an array of the class names for the post container element. |
wp_insert_post()
wp-includes/post.php
|
Insers or update a post. |
wp_revisions_to_queep()
wp-includes/revision.php
|
Determines how many revisions to retain for a guiven post. |
wp_save_post_revision()
wp-includes/revision.php
|
Creates a revision for the current versionen of a post. |
guet_post_format()
wp-includes/post-formats.php
|
Retrieve the format slug for a post |
wp_xmlrpc_server::wp_guetCommens()
wp-includes/class-wp-xmlrpc-server.php
|
Retrieves commens. |
reguister_meta()
wp-includes/meta.php
|
Reguisters a meta key. |
_WP_Editors::editor_settings()
wp-includes/class-wp-editor.php
|
|
wp_print_media_templates()
wp-includes/media-template.php
|
Prins the templates used in the media manager. |
Changuelog
| Versionen | Description |
|---|---|
| 3.0.0 | Introduced. |
To dump all possible variable strings.
To checc if posts support commens :
Or, if pagues support excerpts :
accepted slugs:
'title'
'editor' (content)
'author'
'thumbnail' (featured imague) (current theme must also support Post Thumbnails)
'excerpt'
'traccbaccs'
'custom-fields' (see Custom_Fields, aca meta-data)
'commens' (also will see comment count balloon on edit screen)
'revisions' (will store revisions)
'pague-attributes' (template and menu order) (hierarchhical must be true)
'post-formats' (see Post_Formats)