PHP 클래스 Timber\Post

상속: extends Core, implements Timber\CoreInterface
파일 보기 프로젝트 열기: timber/timber 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$ID string the numeric WordPress id of a post, capitalized to match WP usage
$ImageClass string the name of the class to handle images by default
$PostClass string the name of the class to handle posts by default
$TermClass string the name of the class to handle terms by default
$class string stores the CSS classes for the post (ex: "post post-type-book post-123")
$id string the numeric WordPress id of a post
$object_type string what does this class represent in WordPress terms?
$post_author integer the numeric ID of the a post's author corresponding to the wp_user dtable
$post_content string the raw text of a WP post as stored in the database
$post_date string the raw date string as stored in the WP database, ex: 2014-07-05 18:01:39
$post_excerpt string the raw text of a manual post excerpt as stored in the database
$post_parent integer the numeric ID of a post's parent post
$post_status string the status of a post ("draft", "publish", etc.)
$post_title string the raw text of a post's title as stored in the database
$post_type string the name of the post type, this is the machine name (so "my_custom_post_type" as opposed to "My Custom Post Type")
$representation string what does this class represent in WordPress terms?
$slug string the URL-safe slug, this corresponds to the poorly-named "post_name" in the WP database, ex: "hello-world"

보호된 프로퍼티들

프로퍼티 타입 설명
$__type Timber\PostType
$_content string stores the processed content internally
$_next array stores the results of the next Timber\Post in a set inside an array (in order to manage by-taxonomy)
$_permalink string the returned permalink from WP's get_permalink function
$_prev array stores the results of the previous Timber\Post in a set inside an array (in order to manage by-taxonomy)

공개 메소드들

메소드 설명
__construct ( mixed $pid = null ) If you send the constructor nothing it will try to figure out the current post id based on being inside The_Loop
__toString ( ) : string Outputs the title of the post if you do something like

{{post}}

author ( ) : User | null Return the author of a post
authors ( )
categories ( ) : array Get the categoires on a particular post
category ( ) : TimberTerm | null Returns a category attached to a post
children ( string | array $post_type = 'any', string | boolean $childPostClass = false ) : array Returns an array of children on the post as Timber\Posts (or other claass as you define).
comment_form ( array $args = [] ) : string Gets the comment form for use on a single article page
comments ( integer $count, string $order = 'wp', string $type = 'comment', string $status = 'approve', string $CommentClass = 'Timber\Comment' ) : boolean | array Gets the comments on a Timber\Post and returns them as an array of TimberComments (or whatever comment class you set).
content ( integer $page, $len ) : string Gets the actual content of a WP Post, as opposed to post_content this will run the hooks/filters attached to the_content. \This guy will return your posts content with WordPress filters run on it (like for shortcodes and wpautop).
convert ( array $data, string $class ) Finds any WP_Post objects and converts them to Timber\Posts
date ( string $date_format = '' ) : string Get the date to use in your template!
edit_link ( ) : boolean | string Returns the edit URL of a post if the user has access to it
format ( ) : mixed
get_author ( ) : User | null Gets a User object from the author of the post
get_categories ( ) : array Get the categories for a post
get_category ( ) : mixed
get_children ( string $post_type = 'any', boolean | string $childPostClass = false ) : array
get_comment_count ( ) : integer
get_comments ( integer $count, string $order = 'wp', string $type = 'comment', string $status = 'approve', string $CommentClass = 'Timber\Comment' ) : array | mixed Get the comments for a post
get_content ( integer $len, integer $page ) : string Displays the content of the post with filters, shortcodes and wpautop applied
get_date ( string $date_format = '' ) : string
get_edit_url ( ) : boolean | string Get the URL that will edit the current post/object
get_field ( string $field_name ) : mixed
get_format ( ) : mixed
get_image ( string $field ) : TimberImage
get_link ( ) : string get the permalink for a post object In your templates you should use link: Read my post
get_method_values ( ) : array
get_modified_author ( ) : User | null
get_modified_date ( string $date_format = '' ) : string
get_modified_time ( string $time_format = '' ) : string
get_next ( boolean $taxonomy = false ) : TimberPost | boolean Get the next post in WordPress's ordering
get_paged_content ( ) : string
get_pagination ( ) : array Get a data array of pagination so you can navigate to the previous/next for a paginated post
get_parent ( ) : boolean | TimberPost Get the parent post of the post
get_path ( ) : string Get the permalink for a post, but as a relative path For example, where {{post.link}} would return "http://example.org/2015/07/04/my-cool-post" this will return the relative version: "/2015/07/04/my-cool-post"
get_permalink ( ) : string
get_post_id_by_name ( string $post_name ) : integer get_post_id_by_name($post_name)
get_post_type ( ) : Timber\PostType Returns the post_type object with labels and other info
get_prev ( $in_same_term = false ) : TimberPost | boolean Get the next post in WordPress's ordering
get_preview ( integer $len = 50, boolean $force = false, string $readmore = 'Read More', boolean | string $strip = true, string $end = '…' ) : string get a preview of your post, if you have an excerpt it will use that, otherwise it will pull from the post_content.
get_tags ( ) : array Gets an array of tags for you to use
get_terms ( string | array $tax = '', boolean $merge = true, $TermClass = '' ) : array Get the terms associated with the post This goes across all taxonomies by default
get_thumbnail ( ) : Timber\Image | null
get_title ( ) : string Outputs the title with filters applied
has_field ( string $field_name ) : boolean
has_term ( string | integer $term_name_or_id, string $taxonomy = 'all' ) : boolean
import_custom ( integer $pid ) gets the post custom and attaches it to the current object
import_field ( string $field_name )
link ( ) : string get the permalink for a post object
meta ( string $field_name = null ) : mixed
modified_author ( ) : User | null Get the author (WordPress user) who last modified the post
modified_date ( string $date_format = '' ) : string
modified_time ( string $time_format = '' ) : string
name ( ) : string
next ( boolean $in_same_term = false ) : mixed
paged_content ( ) : string
pagination ( ) : array Get a data array of pagination so you can navigate to the previous/next for a paginated post
parent ( ) : boolean | Timber\Post Gets the parent (if one exists) from a post as a Timber\Post object (or whatever is set in Timber\Post::$PostClass)
password_required ( ) : boolean whether post requires password and correct password has been provided
path ( ) : string Gets the relative path of a WP Post, so while link() will return http://example.org/2015/07/my-cool-post this will return just /2015/07/my-cool-post
permalink ( ) : string
post_class ( string $class = '' ) : string Get the CSS classes for a post. For usage you should use {{post.class}} instead of {{post.post_class}}
prev ( boolean $in_same_term = false ) : mixed Get the previous post in a set
preview ( ) : PostPreview
tags ( ) : array Gets the tags on a post, uses WP's post_tag taxonomy
terms ( string | array $tax = '', boolean $merge = true, $TermClass = '' ) : array Get the terms associated with the post This goes across all taxonomies by default
thumbnail ( ) : TimberImage | null get the featured image as a TimberImage
time ( string $time_format = '' ) : string Get the time to use in your template
title ( ) : string Returns the processed title to be used in templates. This returns the title of the post after WP's filters have run. This is analogous to the_title() in standard WP template tags.
type ( ) : Timber\PostType Returns the post_type object with labels and other info
update ( string $field, mixed $value ) updates the post_meta of the current object with the given value

보호된 메소드들

메소드 설명
check_post_id ( integer $pid ) : integer helps you find the post id regardless of whether you send a string or whatever
determine_id ( $pid ) : integer tries to figure out what post you want to get if not explictly defined (or if it is, allows it to be passed through)
get_info ( integer $pid ) : null | object | WP_Pos\WP_Post Used internally by init, etc. to build TimberPost object
get_post_custom ( integer $pid ) : array Used internally to fetch the metadata fields (wp_postmeta table) and attach them to our TimberPost object
get_post_preview_id ( $query )
get_wp_link_page ( integer $i ) : string
init ( integer $pid = false ) Initializes a Post
maybe_show_password_form ( ) : string | void If the Password form is to be shown, show it!
prepare_post_info ( integer $pid ) : WP_Pos\WP_Post takes a mix of integer (post ID), string (post slug), or object to return a WordPress post object from WP's built-in get_post() function

메소드 상세

__construct() 공개 메소드

If you send the constructor nothing it will try to figure out the current post id based on being inside The_Loop
public __construct ( mixed $pid = null )
$pid mixed

__toString() 공개 메소드

Outputs the title of the post if you do something like

{{post}}

public __toString ( ) : string
리턴 string

author() 공개 메소드

Return the author of a post
public author ( ) : User | null
리턴 User | null A User object if found, false if not

authors() 공개 메소드

public authors ( )

categories() 공개 메소드

Get the categoires on a particular post
public categories ( ) : array
리턴 array of TimberTerms

category() 공개 메소드

Returns a category attached to a post
public category ( ) : TimberTerm | null
리턴 TimberTerm | null

check_post_id() 보호된 메소드

helps you find the post id regardless of whether you send a string or whatever
protected check_post_id ( integer $pid ) : integer
$pid integer ;
리턴 integer ID number of a post

children() 공개 메소드

Returns an array of children on the post as Timber\Posts (or other claass as you define).
public children ( string | array $post_type = 'any', string | boolean $childPostClass = false ) : array
$post_type string | array _optional_ use to find children of a particular post type (attachment vs. page for example). You might want to restrict to certain types of children in case other stuff gets all mucked in there. You can use 'parent' to use the parent's post type or you can pass an array of post types.
$childPostClass string | boolean _optional_ a custom post class (ex: 'MyTimber\Post') to return the objects as. By default (false) it will use Timber\Post::$post_class value.
리턴 array

comment_form() 공개 메소드

Gets the comment form for use on a single article page
public comment_form ( array $args = [] ) : string
$args array this $args thing is a fucking mess, [fix at some point](http://codex.wordpress.org/Function_Reference/comment_form)
리턴 string of HTML for the form

comments() 공개 메소드

Gets the comments on a Timber\Post and returns them as an array of TimberComments (or whatever comment class you set).
public comments ( integer $count, string $order = 'wp', string $type = 'comment', string $status = 'approve', string $CommentClass = 'Timber\Comment' ) : boolean | array
$count integer Set the number of comments you want to get. `0` is analogous to "all"
$order string use ordering set in WordPress admin, or a different scheme
$type string For when other plugins use the comments table for their own special purposes, might be set to 'liveblog' or other depending on what's stored in yr comments table
$status string Could be 'pending', etc.
$CommentClass string What class to use when returning Comment objects. As you become a Timber pro, you might find yourself extending TimberComment for your site or app (obviously, totally optional)
리턴 boolean | array

content() 공개 메소드

Gets the actual content of a WP Post, as opposed to post_content this will run the hooks/filters attached to the_content. \This guy will return your posts content with WordPress filters run on it (like for shortcodes and wpautop).
public content ( integer $page, $len ) : string
$page integer
리턴 string

convert() 공개 메소드

Finds any WP_Post objects and converts them to Timber\Posts
public convert ( array $data, string $class )
$data array
$class string

date() 공개 메소드

Get the date to use in your template!
public date ( string $date_format = '' ) : string
$date_format string
리턴 string

determine_id() 보호된 메소드

tries to figure out what post you want to get if not explictly defined (or if it is, allows it to be passed through)
protected determine_id ( $pid ) : integer
리턴 integer the numberic id we should be using for this post object

format() 공개 메소드

public format ( ) : mixed
리턴 mixed

get_author() 공개 메소드

Gets a User object from the author of the post
또한 보기: Timber\Post::author
사용 중단: since 1.0
public get_author ( ) : User | null
리턴 User | null

get_categories() 공개 메소드

Get the categories for a post
또한 보기: Timber\Post::categories
사용 중단: since 1.0
public get_categories ( ) : array
리턴 array of TimberTerms

get_category() 공개 메소드

또한 보기: Timber\Post::category
사용 중단: since 1.0
public get_category ( ) : mixed
리턴 mixed

get_children() 공개 메소드

또한 보기: Timber\Post::children
사용 중단: since 1.0
public get_children ( string $post_type = 'any', boolean | string $childPostClass = false ) : array
$post_type string
$childPostClass boolean | string
리턴 array

get_comment_count() 공개 메소드

public get_comment_count ( ) : integer
리턴 integer the number of comments on a post

get_comments() 공개 메소드

Get the comments for a post
또한 보기: Timber\Post::comments
public get_comments ( integer $count, string $order = 'wp', string $type = 'comment', string $status = 'approve', string $CommentClass = 'Timber\Comment' ) : array | mixed
$count integer
$order string
$type string
$status string
$CommentClass string
리턴 array | mixed

get_content() 공개 메소드

Displays the content of the post with filters, shortcodes and wpautop applied
public get_content ( integer $len, integer $page ) : string
$len integer
$page integer
리턴 string

get_date() 공개 메소드

또한 보기: Timber\Post::date
사용 중단: since 1.0
public get_date ( string $date_format = '' ) : string
$date_format string
리턴 string

get_edit_url() 공개 메소드

Get the URL that will edit the current post/object
또한 보기: Timber\Post::edit_link
사용 중단: since 1.0
public get_edit_url ( ) : boolean | string
리턴 boolean | string

get_field() 공개 메소드

public get_field ( string $field_name ) : mixed
$field_name string
리턴 mixed

get_format() 공개 메소드

사용 중단: since 1.0
public get_format ( ) : mixed
리턴 mixed

get_image() 공개 메소드

public get_image ( string $field ) : TimberImage
$field string
리턴 TimberImage

get_info() 보호된 메소드

Used internally by init, etc. to build TimberPost object
protected get_info ( integer $pid ) : null | object | WP_Pos\WP_Post
$pid integer
리턴 null | object | WP_Pos\WP_Post

get_method_values() 공개 메소드

public get_method_values ( ) : array
리턴 array

get_modified_author() 공개 메소드

사용 중단: since 1.0
public get_modified_author ( ) : User | null
리턴 User | null

get_modified_date() 공개 메소드

또한 보기: Timber\Post::modified_date
사용 중단: since 1.0
public get_modified_date ( string $date_format = '' ) : string
$date_format string
리턴 string

get_modified_time() 공개 메소드

public get_modified_time ( string $time_format = '' ) : string
$time_format string
리턴 string

get_next() 공개 메소드

Get the next post in WordPress's ordering
사용 중단: since 1.0
public get_next ( boolean $taxonomy = false ) : TimberPost | boolean
$taxonomy boolean
리턴 TimberPost | boolean

get_paged_content() 공개 메소드

public get_paged_content ( ) : string
리턴 string

get_pagination() 공개 메소드

Get a data array of pagination so you can navigate to the previous/next for a paginated post
사용 중단: since 1.0
public get_pagination ( ) : array
리턴 array

get_parent() 공개 메소드

Get the parent post of the post
사용 중단: since 1.0
public get_parent ( ) : boolean | TimberPost
리턴 boolean | TimberPost

get_path() 공개 메소드

Get the permalink for a post, but as a relative path For example, where {{post.link}} would return "http://example.org/2015/07/04/my-cool-post" this will return the relative version: "/2015/07/04/my-cool-post"
사용 중단: since 1.0
public get_path ( ) : string
리턴 string

get_post_custom() 보호된 메소드

Used internally to fetch the metadata fields (wp_postmeta table) and attach them to our TimberPost object
protected get_post_custom ( integer $pid ) : array
$pid integer
리턴 array

get_post_id_by_name() 공개 정적인 메소드

get_post_id_by_name($post_name)
public static get_post_id_by_name ( string $post_name ) : integer
$post_name string
리턴 integer

get_post_preview_id() 보호된 메소드

protected get_post_preview_id ( $query )

get_post_type() 공개 메소드

Returns the post_type object with labels and other info
사용 중단: since 1.0.4
public get_post_type ( ) : Timber\PostType
리턴 Timber\PostType

get_prev() 공개 메소드

Get the next post in WordPress's ordering
사용 중단: since 1.0
public get_prev ( $in_same_term = false ) : TimberPost | boolean
리턴 TimberPost | boolean

get_preview() 공개 메소드

If there's a tag it will use that to mark where to pull through.
public get_preview ( integer $len = 50, boolean $force = false, string $readmore = 'Read More', boolean | string $strip = true, string $end = '…' ) : string
$len integer The number of words that WP should use to make the tease. (Isn't this better than [this mess](http://wordpress.org/support/topic/changing-the-default-length-of-the_excerpt-1?replies=14)?). If you've set a post_excerpt on a post, we'll use that for the preview text; otherwise the first X words of the post_content
$force boolean What happens if your custom post excerpt is longer then the length requested? By default (`$force = false`) it will use the full `post_excerpt`. However, you can set this to true to *force* your excerpt to be of the desired length
$readmore string The text you want to use on the 'readmore' link
$strip boolean | string true for default, false for none, string for list of custom attributes
$end string The text to end the preview with (defaults to ...)
리턴 string of the post preview

get_tags() 공개 메소드

Gets an array of tags for you to use
사용 중단: since 1.0
public get_tags ( ) : array
리턴 array

get_terms() 공개 메소드

Get the terms associated with the post This goes across all taxonomies by default
사용 중단: since 1.0
public get_terms ( string | array $tax = '', boolean $merge = true, $TermClass = '' ) : array
$tax string | array What taxonom(y|ies) to pull from. Defaults to all registered taxonomies for the post type. You can use custom ones, or built-in WordPress taxonomies (category, tag). Timber plays nice and figures out that tag/tags/post_tag are all the same (and categories/category), for custom taxonomies you're on your own.
$merge boolean Should the resulting array be one big one (true)? Or should it be an array of sub-arrays for each taxonomy (false)?
리턴 array

get_thumbnail() 공개 메소드

또한 보기: TimberPost::thumbnail
사용 중단: since 1.0
public get_thumbnail ( ) : Timber\Image | null
리턴 Timber\Image | null

get_title() 공개 메소드

Outputs the title with filters applied
사용 중단: since 1.0
public get_title ( ) : string
리턴 string

has_field() 공개 메소드

public has_field ( string $field_name ) : boolean
$field_name string
리턴 boolean

has_term() 공개 메소드

public has_term ( string | integer $term_name_or_id, string $taxonomy = 'all' ) : boolean
$term_name_or_id string | integer
$taxonomy string
리턴 boolean

import_custom() 공개 메소드

gets the post custom and attaches it to the current object
public import_custom ( integer $pid )
$pid integer a post ID number

import_field() 공개 메소드

public import_field ( string $field_name )
$field_name string

init() 보호된 메소드

Initializes a Post
protected init ( integer $pid = false )
$pid integer

maybe_show_password_form() 보호된 메소드

If the Password form is to be shown, show it!
protected maybe_show_password_form ( ) : string | void
리턴 string | void

meta() 공개 메소드

public meta ( string $field_name = null ) : mixed
$field_name string
리턴 mixed

modified_author() 공개 메소드

Get the author (WordPress user) who last modified the post
public modified_author ( ) : User | null
리턴 User | null A User object if found, false if not

modified_date() 공개 메소드

public modified_date ( string $date_format = '' ) : string
$date_format string
리턴 string

modified_time() 공개 메소드

public modified_time ( string $time_format = '' ) : string
$time_format string
리턴 string

name() 공개 메소드

public name ( ) : string
리턴 string

next() 공개 메소드

public next ( boolean $in_same_term = false ) : mixed
$in_same_term boolean
리턴 mixed

paged_content() 공개 메소드

public paged_content ( ) : string
리턴 string

pagination() 공개 메소드

Get a data array of pagination so you can navigate to the previous/next for a paginated post
public pagination ( ) : array
리턴 array

parent() 공개 메소드

Gets the parent (if one exists) from a post as a Timber\Post object (or whatever is set in Timber\Post::$PostClass)
public parent ( ) : boolean | Timber\Post
리턴 boolean | Timber\Post

password_required() 공개 메소드

whether post requires password and correct password has been provided
public password_required ( ) : boolean
리턴 boolean

path() 공개 메소드

Gets the relative path of a WP Post, so while link() will return http://example.org/2015/07/my-cool-post this will return just /2015/07/my-cool-post
public path ( ) : string
리턴 string

post_class() 공개 메소드

Get the CSS classes for a post. For usage you should use {{post.class}} instead of {{post.post_class}}
또한 보기: Timber\Post::$class
public post_class ( string $class = '' ) : string
$class string additional classes you want to add
리턴 string a space-seperated list of classes

prepare_post_info() 보호된 메소드

takes a mix of integer (post ID), string (post slug), or object to return a WordPress post object from WP's built-in get_post() function
protected prepare_post_info ( integer $pid ) : WP_Pos\WP_Post
$pid integer
리턴 WP_Pos\WP_Post on success

prev() 공개 메소드

Get the previous post in a set
public prev ( boolean $in_same_term = false ) : mixed
$in_same_term boolean
리턴 mixed

preview() 공개 메소드

public preview ( ) : PostPreview
리턴 PostPreview

tags() 공개 메소드

Gets the tags on a post, uses WP's post_tag taxonomy
public tags ( ) : array
리턴 array

terms() 공개 메소드

Get the terms associated with the post This goes across all taxonomies by default
public terms ( string | array $tax = '', boolean $merge = true, $TermClass = '' ) : array
$tax string | array What taxonom(y|ies) to pull from. Defaults to all registered taxonomies for the post type. You can use custom ones, or built-in WordPress taxonomies (category, tag). Timber plays nice and figures out that tag/tags/post_tag are all the same (and categories/category), for custom taxonomies you're on your own.
$merge boolean Should the resulting array be one big one (true)? Or should it be an array of sub-arrays for each taxonomy (false)?
리턴 array

thumbnail() 공개 메소드

get the featured image as a TimberImage
public thumbnail ( ) : TimberImage | null
리턴 TimberImage | null of your thumbnail

time() 공개 메소드

Get the time to use in your template
public time ( string $time_format = '' ) : string
$time_format string
리턴 string

title() 공개 메소드

Returns the processed title to be used in templates. This returns the title of the post after WP's filters have run. This is analogous to the_title() in standard WP template tags.
public title ( ) : string
리턴 string

type() 공개 메소드

Returns the post_type object with labels and other info
부터: 1.0.4
public type ( ) : Timber\PostType
리턴 Timber\PostType

update() 공개 메소드

updates the post_meta of the current object with the given value
public update ( string $field, mixed $value )
$field string
$value mixed

프로퍼티 상세

$ID 공개적으로 프로퍼티

the numeric WordPress id of a post, capitalized to match WP usage
public string $ID
리턴 string

$ImageClass 공개적으로 프로퍼티

the name of the class to handle images by default
public string $ImageClass
리턴 string

$PostClass 공개적으로 프로퍼티

the name of the class to handle posts by default
public string $PostClass
리턴 string

$TermClass 공개적으로 프로퍼티

the name of the class to handle terms by default
public string $TermClass
리턴 string

$__type 보호되어 있는 프로퍼티

protected PostType,Timber $__type
리턴 Timber\PostType

$_content 보호되어 있는 프로퍼티

stores the processed content internally
protected string $_content
리턴 string

$_next 보호되어 있는 프로퍼티

stores the results of the next Timber\Post in a set inside an array (in order to manage by-taxonomy)
protected array $_next
리턴 array

$_prev 보호되어 있는 프로퍼티

stores the results of the previous Timber\Post in a set inside an array (in order to manage by-taxonomy)
protected array $_prev
리턴 array

$class 공개적으로 프로퍼티

stores the CSS classes for the post (ex: "post post-type-book post-123")
public string $class
리턴 string

$id 공개적으로 프로퍼티

the numeric WordPress id of a post
public string $id
리턴 string

$object_type 공개적으로 프로퍼티

what does this class represent in WordPress terms?
public string $object_type
리턴 string

$post_author 공개적으로 프로퍼티

the numeric ID of the a post's author corresponding to the wp_user dtable
public int $post_author
리턴 integer

$post_content 공개적으로 프로퍼티

the raw text of a WP post as stored in the database
public string $post_content
리턴 string

$post_date 공개적으로 프로퍼티

the raw date string as stored in the WP database, ex: 2014-07-05 18:01:39
public string $post_date
리턴 string

$post_excerpt 공개적으로 프로퍼티

the raw text of a manual post excerpt as stored in the database
public string $post_excerpt
리턴 string

$post_parent 공개적으로 프로퍼티

the numeric ID of a post's parent post
public int $post_parent
리턴 integer

$post_status 공개적으로 프로퍼티

the status of a post ("draft", "publish", etc.)
public string $post_status
리턴 string

$post_title 공개적으로 프로퍼티

the raw text of a post's title as stored in the database
public string $post_title
리턴 string

$post_type 공개적으로 프로퍼티

the name of the post type, this is the machine name (so "my_custom_post_type" as opposed to "My Custom Post Type")
public string $post_type
리턴 string

$representation 공개적으로 정적으로 프로퍼티

what does this class represent in WordPress terms?
public static string $representation
리턴 string

$slug 공개적으로 프로퍼티

the URL-safe slug, this corresponds to the poorly-named "post_name" in the WP database, ex: "hello-world"
public string $slug
리턴 string