Do you find yourself constantly Googling the attributes of the WordPress Post Object?
Is it $post->title or $post->post_title?
Why does $post->id return nothing? Oh, right, because it’s one of the attributes that’s capitalized so it should be $post->ID.
Well, bookmark this link and search no longer:
public 'ID' => int public 'post_author' => string public 'post_date' => string public 'post_date_gmt' => string public 'post_content' => string public 'post_title' => string public 'post_excerpt' => string public 'post_status' => string public 'comment_status' => string public 'ping_status' => string public 'post_password' => string public 'post_name' => string public 'to_ping' => string public 'pinged' => string public 'post_modified' => string public 'post_modified_gmt' => string public 'post_content_filtered' => string public 'post_parent' => int public 'guid' => string public 'menu_order' => int public 'post_type' => string public 'post_mime_type' => string public 'comment_count' => string public 'filter' => string
References #
WordPress Documentation on the WP_POST object – you’ll need to dig into the code shown there. Not quite sure why they didn’t list these fields out there. But that’s WP docs for you.
More Topics In Articles #
- A Guide to SPF, DMARC & DKIM for WordPress
- Our Release Cycle: Fast Ring & Slow Ring Releases
- Sizing Your WordPress Servers
- Deployment Options For DVI
- Add Your Existing SSH Key To A Root User Account
- All About WP Crons
- Setup Low Disk Space Alerts
- Identify The Largest Files In The WordPress Uploads Folder
- Identify The Largest Sites On Your Server
- Identify The Largest Backups On Your Server
- SSL Rate Limits
- Unable To Create Files (Even With Available Diskspace)
- Managing Linux Updates
- How To Lock A Linux User
- All About Ubuntu LTS Versions
- Rapid Reset HTTP/2 & DevelopVIDeploy