wp_get_post_categories( int $post_id, array $args = array() )

Retrieve the list of categories for a post.

25 related functions found for: wp_get_post_categories

Top ↑

Related terms found for this post

wp-parser-related-wordscategori, categories, category, get, post, post-php, post-typ, post-type, taxonomi, taxonomy, wp-get, wp-includes
wp-parser-packagePost, WordPress

Top ↑

Terms Used Terms Used

Terms used in the related posts query

  • categori
  • categories
  • category
  • get
  • post
  • Post
  • post-php
  • post-typ
  • post-type
  • taxonomi
  • taxonomy
  • wp-get
  • wp-includes
  • wp-includes/post.php

Top ↑

Description Description

Compatibility layer for themes and plugins. Also an easy layer of abstraction away from the complexity of the taxonomy layer.

Top ↑

Parameters Parameters


(int) (Optional) The Post ID. Does not default to the ID of the global $post. Default 0.


(array) (Optional) Category query parameters. See WP_Term_Query::__construct() for supported arguments.

Default value: array()

Top ↑

Return Return

(array|WP_Error) List of categories. If the $fields argument passed via $args is 'all' or 'all_with_object_id', an array of WP_Term objects will be returned. If $fields is 'ids', an array of category ids. If $fields is 'names', an array of category names. WP_Error object if 'category' taxonomy doesn't exist.

Top ↑

Source Source

File: wp-includes/post.php


Top ↑

Changelog Changelog

Version Description
2.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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