get_all_post_type_supports( string $post_type ): array

Gets all the post type features

Parameters

$post_typestringrequired
The post type.

Return

array Post type supports list.

Source

function get_all_post_type_supports( $post_type ) {
	global $_wp_post_type_features;

	if ( isset( $_wp_post_type_features[ $post_type ] ) ) {
		return $_wp_post_type_features[ $post_type ];
	}

	return array();
}

Changelog

VersionDescription
3.4.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    The return value of this function is an associative array, not a list.

    For example, if a post type supports the ‘title’ and ‘editor’ features, the return value will be:

    array(24) {
      ["title"]=>
      bool(true)
      ["editor"]=>
      bool(true)
    }

    It will not be the list:

    array(10) {
      [0]=>
      string(5) "title"
      [1]=>
      string(6) "editor"
    }

You must log in before being able to contribute a note or feedback.