kisukedeath

WP Post Object

Apr 25th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.70 KB | None | 0 0
  1. For reference, WP_Post OBJECT contains following fields:
  2.  
  3. WP_Post Object
  4. (
  5.     [ID] =>
  6.     [post_author] =>
  7.     [post_date] =>
  8.     [post_date_gmt] =>
  9.     [post_content] =>
  10.     [post_title] =>
  11.     [post_excerpt] =>
  12.     [post_status] =>
  13.     [comment_status] =>
  14.     [ping_status] =>
  15.     [post_password] =>
  16.     [post_name] =>
  17.     [to_ping] =>
  18.     [pinged] =>
  19.     [post_modified] =>
  20.     [post_modified_gmt] =>
  21.     [post_content_filtered] =>
  22.     [post_parent] =>
  23.     [guid] =>
  24.     [menu_order] =>
  25.     [post_type] =>
  26.     [post_mime_type] =>
  27.     [comment_count] =>
  28.     [filter] =>
  29. )
  30.  
  31. For Reference : WP_Post Object has following properties, which are returned by get_post().
  32.  
  33. Member Variable Variable Type   Notes
  34. ID          int     The ID of the post
  35. post_author     string  The post author's user ID (numeric string)
  36. post_name   string  The post's slug
  37. post_type   string  See Post Types
  38. post_title  string  The title of the post
  39. post_date   string  Format: 0000-00-00 00:00:00
  40. post_date_gmt   string  Format: 0000-00-00 00:00:00
  41. post_content    string  The full content of the post
  42. post_excerpt    string  User-defined post excerpt
  43. post_status     string  See get_post_status for values
  44. comment_status  string  Returns: { open, closed }
  45. ping_status     string  Returns: { open, closed }
  46. post_password   string  Returns empty string if no password
  47. post_parent     int     Parent Post ID (default 0)
  48. post_modified   string  Format: 0000-00-00 00:00:00
  49. post_modified_gmt   string  Format: 0000-00-00 00:00:00
  50. comment_count   string  Number of comments on post (numeric string)
  51. menu_order  string  Order value as set through page-attribute when enabled (numeric string. Defaults to 0)
Advertisement
Add Comment
Please, Sign In to add comment