Advertisements

add_post_type_support

Definition:
function add_post_type_support( $post_type, $feature ) {}

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’.

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

Source code

function add_post_type_support( $post_type, $feature ) {

	global $_wp_post_type_features;



	$features = (array) $feature;

	foreach ($features as $feature) {

		if ( func_num_args() == 2 )

			$_wp_post_type_features[$post_type][$feature] = true;

		else

			$_wp_post_type_features[$post_type][$feature] = array_slice( func_get_args(), 2 );

	}

}

285

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: