Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




add_post_type_support [ WordPress Function ]

add_post_type_support ( $post_type, $feature )
Parameters:
  • (string) $post_type The post type for which to add the feature
  • (string|array) $feature the feature being added, can be an array of feature strings or a single string
Defined at:



Register support of certain features for a post type.

All features are directly associated with a functional area of the edit screen, such as the editor or a meta box: 'title', 'editor', 'comments', 'revisions', 'trackbacks', 'author', 'excerpt', 'page-attributes', 'thumbnail', and 'custom-fields'.

Additionally, the 'revisions' feature dictates whether the post type will store revisions, and the 'comments' feature dictates whether the comments count will show on the edit screen.

Source


<?php
function add_post_type_support$post_type$feature ) {
    global 
$_wp_post_type_features;

    
$features = (array) $feature;
    foreach (
$features as $feature) {
        if ( 
func_num_args() == )
            
$_wp_post_type_features[$post_type][$feature] = true;
        else
            
$_wp_post_type_features[$post_type][$feature] = array_slicefunc_get_args(), );
    }
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics