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

Gets a list of all registered post type objects.

Related Functions

get_post_type, set_post_type, get_post_mime_types, get_post_states, get_post_type_labels

Top Google Results

User discussions

wpseek mobile