PHP Class mtv\wp\models\Post
Core post fields directly from WordPress:
id // ID of the post
post_author // ID of the post author
post_date // timestamp in local time
post_date_gmt // timestamp in gmt time
post_content // Full body of the post
post_title // title of the post
post_excerpt // excerpt field of the post, caption if attachment
post_status // post status: publish, new, pending, draft, auto-draft, future, private, inherit, trash
comment_status // comment status: open, closed
ping_status // ping/trackback status
post_password // password of the post
post_name // post slug, string to use in the URL
to_ping // to ping ??
pinged // pinged ??
post_modified // timestamp in local time
post_modified_gmt // timestatmp in gmt tim
post_content_filtered // filtered content ??
post_parent // id of the parent post, if attachment, id of the post that uses this image
guid // global unique id of the post
menu_order // menu order
post_type // type of post: post, page, attachment, or custom string
post_mime_type // mime type for attachment posts
comment_count // number of comments
filter // filter ??
Special MTV fields:
post_meta // an array containing all of the meta for this post
blogid // id number of the blog this post lives on
post_format // the post_format for this post
url // attachments only, url of the original uploaded image or whatever
thumb_url // attachments only, url of the thumbnail image, if thumbnails are enabled
Post object functions
password_required()
Whether post requires password and correct password has been provided.
is_sticky()
Check if post is sticky.
post_class()
Retrieve the classes for the post div as an array.
permalink()
permalink for this post, from WP get_permalink()
categories()
returns an array of categories that are associated with this post
tags()
returns an array of tags that are associated with this post
featured_image()
Returns a Post object representing the featured image
attachments( $extra_query_args )
Returns a PostCollection object representing attachments (gallery images)
the_time( $format )
Returns a formatted date string. Works like WordPress's 'the_time'.
the_date( $format )
Returns a formatted date string. Works like WordPress's 'the_date'.
make_excerpt( $more_text )
Returns a generated excerpt. Simliar to how WordPress makes excerpts in The Loop.
Exibir arquivo
Open project: newsapps/wordpress-mtv
Class Usage Examples
Public Properties
Public Methods
Method Details
__toString()
public method
categories()
public method
clear_attachments()
public method
# TODO: optimize with SQL
featured_image()
public method
get_attachments()
public method
is_sticky()
public method
make_excerpt()
public method
public parse ( &$postdata ) |
password_required()
public method
permalink()
public method
post_class()
public method
set_attachments()
public method
the_content()
public method
Property Details
$cache_groups public_oe property