PHP Класс 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.
Наследование: extends mtv\models\Model
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$cache_groups

Открытые методы

Метод Описание
__toString ( )
categories ( )
clear_attachments ( ) # TODO: optimize with SQL
featured_image ( )
fetch ( )
get_attachments ( )
is_sticky ( )
make_excerpt ( $more_text = null )
parse ( &$postdata )
password_required ( )
permalink ( )
post_class ( $class = '' )
save ( )
set_attachments ( $attachments )
tags ( )
the_content ( )
the_date ( $format = null )
the_time ( $format = null )

Описание методов

__toString() публичный Метод

public __toString ( )

categories() публичный Метод

public categories ( )

clear_attachments() публичный Метод

# TODO: optimize with SQL
public clear_attachments ( )

fetch() публичный Метод

public fetch ( )

get_attachments() публичный Метод

public get_attachments ( )

is_sticky() публичный Метод

public is_sticky ( )

make_excerpt() публичный Метод

public make_excerpt ( $more_text = null )

parse() публичный Метод

public parse ( &$postdata )

password_required() публичный Метод

public password_required ( )

post_class() публичный Метод

public post_class ( $class = '' )

save() публичный Метод

public save ( )

set_attachments() публичный Метод

public set_attachments ( $attachments )

tags() публичный Метод

public tags ( )

the_content() публичный Метод

public the_content ( )

the_date() публичный Метод

public the_date ( $format = null )

the_time() публичный Метод

public the_time ( $format = null )

Описание свойств

$cache_groups публичное свойство

public $cache_groups