wp_get_post_cats

Retrieves a list of post categories.

Description

(array) wp_get_post_cats( (string) $blogid = '1', (int) $post_ID = 0 ); 

Returns (array)

Parameters (2)

0. $blogid — Optional. (string) => '1'
The blogid.
1. $post_id (int)
The post id.

Usage

  1. if ( !function_exists( 'wp_get_post_cats' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // The blogid. 
  5. $blogid = '1'; 
  6.  
  7. // The post id. 
  8. $post_id = -1; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wp_get_post_cats($blogid, $post_id); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/deprecated.php  
  1. function wp_get_post_cats($blogid = '1', $post_ID = 0) { 
  2. _deprecated_function( __FUNCTION__, '2.1.0', 'wp_get_post_categories()' ); 
  3. return wp_get_post_categories($post_ID);