WPDev.one
Core Function
View Source on Trac ↗

get_post_types_by_support()

get_post_types_by_support( mixed $feature, mixed $operator = 'and' )

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

Parameters 2 required

Name / Type Description
(array

| string) $feature Single feature or an array of features the post types should support.

Required
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'.

Required

Return Value

(string[])
A list of post type names.

Function Information

Since Version
4.5.0
Source File
wp-includes/post.php
Advertisement