WP_Post_Type::remove_supports() WordPress Method

The WP_Post_Type::remove_supports() method is used to remove support for a given feature from a post type. This is useful if you want to de-register support for something like post thumbnails, which can be resource intensive, or if you want to change the way that your content is displayed and don't want certain features to be available. You can use the remove_supports() method like this: $post_type_object = get_post_type_object( 'my_post_type' ); $post_type_object->remove_supports( 'thumbnail' );

WP_Post_Type::remove_supports() #

Removes the features support for the post type.


Source

File: wp-includes/class-wp-post-type.php

	public function remove_supports() {
		global $_wp_post_type_features;

		unset( $_wp_post_type_features[ $this->name ] );
	}

Top ↑

Changelog

Changelog
VersionDescription
4.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.