get_post_types_by_support() – Retrieves a list of post type names that support a specific feature.

You appear to be a bot. Output may be restricted

Description

Retrieves a list of post type names that support a specific feature.

Usage

$string[] = get_post_types_by_support( $feature, $operator );

Parameters

$feature
( array|string ) required – Single feature or an array of features the post types should support.
$operator
( string ) optional default: and – Optional. The logical operation to perform. 'or' means only one element from the array needs to match; 'and' means all elements must match; 'not' means no elements may match. Default 'and'.

Returns

string[] A list of post type names.

Source

File name: wordpress/wp-includes/post.php
Lines:

1 to 7 of 7
function get_post_types_by_support( $feature, $operator = 'and' ) {
  global $_wp_post_type_features;

  $features = array_fill_keys( (array) $feature, true );

  return array_keys( wp_filter_object_list( $_wp_post_type_features, $features, $operator ) );
}
 

 View on GitHub View on Trac