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: - Introduced in WordPress: 2.9.0
- Deprecated in WordPress: —
Description
Gets a list of all registered post type objects.