get_post_taxonomies() WordPress Function

The get_post_taxonomies() function is used to retrieve the taxonomies associated with a post. This function returns an array of taxonomy objects.

get_post_taxonomies( int|WP_Post $post ) #

Retrieves all taxonomy names for the given post.


Parameters

$post

(int|WP_Post)(Optional) Post ID or WP_Post object. Default is global $post.


Top ↑

Return

(string[]) An array of all taxonomy names for the given post.


Top ↑

Source

File: wp-includes/taxonomy.php

function get_post_taxonomies( $post = 0 ) {
	$post = get_post( $post );

	return get_object_taxonomies( $post );
}


Top ↑

Changelog

Changelog
VersionDescription
2.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More