Methods → post
This property / method will either return the current post object, assign a new post as the current post or create and return a new post object if a post ID argument is given.
Description
object atom()->post
object atom()->post($post [, $setup_postdata = false])
- $post
- Post ID (an object can also be given)
- $setup_postdata
- Sets up WP’s post globals to point to this post. If set to true,
resetCurrentPost()
must be called after all operations on the current object are completed, so the original post gets restored.
Examples
// output the title of the post that has the ID 2 atom()->post(2)->Title(); // output the title of the current post atom()->post->Title();
Last revision 12 years