wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



get_post_types_by_support › WordPress Function

Od4.5.0
Przestarzałyn/a
get_post_types_by_support ( $feature, $operator = 'and' )
Parametry: (2)
  • (array|string) $feature Single feature or an array of features the post types should support.
    Wymagane: Tak
  • (string) $operator 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'.
    Wymagane: Nie
    Domyślny: 'and'
Powrót:
  • (string[]) A list of post type names.
Zdefiniowane na:
Codex:

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



Źródło

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 ) );
}