Skip to content

Instantly share code, notes, and snippets.

@MasterHans
Created March 8, 2016 16:17
Show Gist options
  • Select an option

  • Save MasterHans/0526089ccfa5f98c64b8 to your computer and use it in GitHub Desktop.

Select an option

Save MasterHans/0526089ccfa5f98c64b8 to your computer and use it in GitHub Desktop.
$post Object properties
Property Sample Value Notes
ID 432 Post ID
post_author 1 Post author's user number
post_date 2008-03-15 19:22:29
post_date_gmt 2008-03-16 02:22:29 GMT = Greenwich Mean Time
post_content Actual post content, including markup
post_title Post title
post_category 0 Number representing post category ID#
post_excerpt Plain text without markup
post_status publish, pending, draft, private, inherit Current status of the post
comment_status open Possible values: open / closed
ping_status open open / closed
post_password Will be empty if no password
post_name statistics Same as post slug
to_ping http://www.1to-ping.com, http://www.2to-ping.com, http://www.3to-ping.com List of urls to ping when post is published (for unpublished posts)
pinged http://www.pinged1.com, http://www.pinged2.com, http://www.pinged3.com List of urls that have been pinged (for published posts)
post_modified 2008-07-01 19:41:28 Date the post was last modified
post_modified_gmt 2008-07-02 02:41:28 GMT date post was last modified
post_content_filtered Exists to store a cached version of post content (most likely with all the the_content filters already applied). If you’ve got a plugin that runs a very resource heavy filter on content, you might consider caching the results with post_content_filtered, and calling that from the front end instead.
post_parent ID# of this post's parent. In the case of attachments, will be the post it's attached to. Defaults to 0 if no parent.
guid http://www.blogurl/postslug Global Unique Identifier. The "real" URL to the post, not the permalink version. For pages, this is the actual URL. In the case of files (attachments), this holds the URL to the file.
menu_order 0
1
2
etc… Holds values for display order of pages. Only works with pages, not posts.
post_type page
post
attachment
revision Self-explanatory for pages and posts. Any files uploaded are attachments and post revisions saved as revision
post_mime_type text/html
image/png
image/jpg Only used for files (attachments). Contains the MIME type of the uploaded file.
comment_count 4 Number of comments, pings, and trackbacks combined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment