get_post_types


get_post_types ( $args = array(), $output = 'names', $operator = 'and' )

Parameters:
  • (array|string) $args Optional. An array of key => value arguments to match against the post type objects. Default empty array.
  • (string) $output Optional. The type of output to return. Accepts post type 'names' or 'objects'. Default 'names'.
  • (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'.
See:
Returns:
  • (string[]|WP_Post_Type[]) An array of post type names or objects.
Defined at:

Description

Get a list of all registered post type objects.

Related Functions

get_post_type, set_post_type, get_post_mime_types, get_post_type_labels, get_post_mime_type

Top Google Results

User discussions

wpseek mobile