wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
add_post_type_support › WordPress Function
Seit3.0.0
Veraltetn/v
› add_post_type_support ( $post_type, $feature, $args )
Parameter: (3) |
|
Definiert in: |
|
Codex: | |
Changelog: |
|
Registers support of certain features for a post type.
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', ) );Ähnliche Funktionen: post_type_supports, get_all_post_type_supports, remove_post_type_support, get_post_types_by_support, add_theme_support
Quellcode
function add_post_type_support( $post_type, $feature, ...$args ) { global $_wp_post_type_features; $features = (array) $feature; foreach ( $features as $feature ) { if ( $args ) { $_wp_post_type_features[ $post_type ][ $feature ] = $args; } else { $_wp_post_type_features[ $post_type ][ $feature ] = true; } } }