WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get post taxonomies

Description

Retrieve all taxonomies of a post with just the names.

Usage

<?php get_post_taxonomies$post ); ?>

Parameters

$post
(int | object) (required) Post ID or a post object (row from posts)
Default: None

Return Values

(array) 
All taxonomy names for the given post or post object

Examples

<?php 

   $taxonomy_names = get_post_taxonomies( );
   print_r( $taxonomy_names );

?>

will typically output:

Array
(
    [0] => category
    [1] => post_tag
    [2] => post_format
)

Change Log

Since: 2.5.0

Source File

get_post_taxonomies() is located in wp-includes/taxonomy.php.

Related

See also index of Function Reference and index of Template Tags.