get_post_taxonomies( int|WP_Post $post )

Retrieve all taxonomies of a post with just the names.


Description Description


Parameters Parameters

$post

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


Top ↑

Return Return

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


Top ↑

Source Source

File: wp-includes/taxonomy.php

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

	return get_object_taxonomies( $post );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.5.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 2 content
    Contributed by deeptiboddapati

    #return section should say that the function returns an array of all taxonomy names for the given post or post object instead of just an array.
    This highlights the main point of difference between get_post_taxonomies and get_object_taxonomies which can return an array of all taxonomy names or an array of all taxonomy objects.

    https://codex.wordpress.org/Function_Reference/get_post_taxonomies

    http://wpsocket.com/wpref/function/get_object_taxonomies/

You must log in before being able to contribute a note or feedback.