#20259 closed enhancement (duplicate)
WP_Post
Reported by: | braydonf | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
A class to group all related template tags/functions for a post so that the global $post variable isn't required to be used from template tags.
All existing template tags would continue to work, as-is, and this would provide a new API for writing templates.
Each post_type could have it's own class that would be extended based on a standard WP_Post class.
Here are some ideas for similar functionality and use:
Template Tag | WP_Post function |
get_permalink() | $post->permalink() |
the_title() | $post->title() |
the_content() | $post->body() |
the_excerpt() | $post->excerpt() |
the_date() | $post->date() |
get_post_meta() | $post->meta() |
get_children() | $post->attachments() |
the_post_thumbnail() | $post->image() |
Change History (3)
Note: See
TracTickets for help on using
tickets.
Duplicate of #12267?