get_object_taxonomies


get_object_taxonomies ( $object, $output = 'names' )

Parameters:
  • (array|string|WP_Post) $object Name of the type of taxonomy object, or an object (row from posts)
  • (string) $output Optional. The type of output to return in the array. Accepts either taxonomy 'names' or 'objects'. Default 'names'.
Returns:
  • (array) The names of all taxonomy of $object_type.
Defined at:

Description

Return the names or objects of the taxonomies which are registered for the requested object or object type, such as a post object or post type name.

Example:

$taxonomies = get_object_taxonomies( 'post' );

This results in:

Array( 'category', 'post_tag' )

Related Functions

get_post_taxonomies, get_the_taxonomies, get_taxonomies, get_attachment_taxonomies, the_taxonomies

Top Google Results

User discussions

wpseek mobile