PHP 클래스 WPLib_Posts, wplib

상속: extends WPLib_Module_Base
파일 보기 프로젝트 열기: wplib/wplib 1 사용 예제들

공개 메소드들

메소드 설명
_clear_post_type_args ( ) Run on WordPress's 'init' hook to register all the post types defined in classes that extend this class.
_get_post_type_label ( string $post_type, string $label_type ) : string
_get_post_type_labels ( string $post_type ) : array
_init ( ) Run on WordPress's 'init' hook to register all the post types defined in classes that extend this class.
_init_99 ( ) Clear out this data, we don't need them anymore But do it late so that a regular 'init' can still access them, i.e. for changing labels of 'post' post type.
_set_post_type_args ( string $post_type_slug, array $args ) Save $args for later passing to register_post_type().
_set_post_type_labels ( string $post_type, array $args ) : array
_wp_loaded ( ) Add a property to post type objects so they can be self-identified.
default_post_type_labels ( ) : array
get_list ( array | string | WPLib_Query $query = [], array $args = [] ) : WPLib_Post_List_Default
get_post ( WP_Post | object | integer | string | array | null | boolean $_post, string | boolean $post_type = false ) : null | WP_Post
get_post_by ( string $by, integer | string $value, array $args = [] ) : WP_Post
get_post_type_class ( string $post_type ) : string | null
get_post_types_supporting ( string $feature ) : array Get a list of post types that support a specific named feature.
get_posts ( WP_Query | array $args = [] ) : WP_Post[] Query the posts, return a post list.
get_queried_post_type ( ) : false | null | string Return the post type of the queried object.
get_query ( array $args = [] ) : WPLib_Query Query the posts. Equivalent to creating a new WP_Query which both instantiates and queries the DB.
make_new_item ( WP_Post | integer $_post, array $args = [] ) : mixed Create new Instance of a Post MVI
max_posts_per_page ( ) : integer
on_load ( ) Run on WordPress's 'init' hook to register all the post types defined in classes that extend this class.
pop_post ( )
post_type_classes ( ) : string[]
push_post ( WP_Post | boolean $value = false )
set_max_posts_per_page ( integer $value )

메소드 상세

_clear_post_type_args() 정적인 공개 메소드

Run on WordPress's 'init' hook to register all the post types defined in classes that extend this class.
static public _clear_post_type_args ( )

_get_post_type_label() 정적인 공개 메소드

static public _get_post_type_label ( string $post_type, string $label_type ) : string
$post_type string
$label_type string
리턴 string

_get_post_type_labels() 정적인 공개 메소드

static public _get_post_type_labels ( string $post_type ) : array
$post_type string
리턴 array

_init() 정적인 공개 메소드

Run on WordPress's 'init' hook to register all the post types defined in classes that extend this class.
static public _init ( )

_init_99() 정적인 공개 메소드

Clear out this data, we don't need them anymore But do it late so that a regular 'init' can still access them, i.e. for changing labels of 'post' post type.
static public _init_99 ( )

_set_post_type_args() 정적인 공개 메소드

Save $args for later passing to register_post_type().
static public _set_post_type_args ( string $post_type_slug, array $args )
$post_type_slug string
$args array

_set_post_type_labels() 정적인 공개 메소드

static public _set_post_type_labels ( string $post_type, array $args ) : array
$post_type string
$args array
리턴 array

_wp_loaded() 정적인 공개 메소드

Add a property to post type objects so they can be self-identified.
static public _wp_loaded ( )

default_post_type_labels() 정적인 공개 메소드

static public default_post_type_labels ( ) : array
리턴 array

get_list() 정적인 공개 메소드

static public get_list ( array | string | WPLib_Query $query = [], array $args = [] ) : WPLib_Post_List_Default
$query array | string | WPLib_Query
$args array
리턴 WPLib_Post_List_Default

get_post() 정적인 공개 메소드

static public get_post ( WP_Post | object | integer | string | array | null | boolean $_post, string | boolean $post_type = false ) : null | WP_Post
$_post WP_Post | object | integer | string | array | null | boolean
$post_type string | boolean
리턴 null | WP_Post

get_post_by() 정적인 공개 메소드

static public get_post_by ( string $by, integer | string $value, array $args = [] ) : WP_Post
$by string
$value integer | string
$args array
리턴 WP_Post

get_post_type_class() 정적인 공개 메소드

static public get_post_type_class ( string $post_type ) : string | null
$post_type string
리턴 string | null

get_post_types_supporting() 정적인 공개 메소드

Get a list of post types that support a specific named feature.
static public get_post_types_supporting ( string $feature ) : array
$feature string
리턴 array

get_posts() 정적인 공개 메소드

Query the posts, return a post list.
static public get_posts ( WP_Query | array $args = [] ) : WP_Post[]
$args WP_Query | array
리턴 WP_Post[]

get_queried_post_type() 정적인 공개 메소드

Return the post type of the queried object.
static public get_queried_post_type ( ) : false | null | string
리턴 false | null | string

get_query() 정적인 공개 메소드

Query the posts. Equivalent to creating a new WP_Query which both instantiates and queries the DB.
또한 보기: https://github.com/wplib/wplib/commit/8dc27c368e84f7ba6e1448753e1b1f082a60ac6d#commitcomment-11026403
static public get_query ( array $args = [] ) : WPLib_Query
$args array
리턴 WPLib_Query

make_new_item() 정적인 공개 메소드

Create new Instance of a Post MVI
static public make_new_item ( WP_Post | integer $_post, array $args = [] ) : mixed
$_post WP_Post | integer
$args array { @type string $instance_class @type string $list_owner }
리턴 mixed

max_posts_per_page() 정적인 공개 메소드

static public max_posts_per_page ( ) : integer
리턴 integer

on_load() 정적인 공개 메소드

Run on WordPress's 'init' hook to register all the post types defined in classes that extend this class.
static public on_load ( )

pop_post() 정적인 공개 메소드

static public pop_post ( )

post_type_classes() 정적인 공개 메소드

static public post_type_classes ( ) : string[]
리턴 string[]

push_post() 정적인 공개 메소드

static public push_post ( WP_Post | boolean $value = false )
$value WP_Post | boolean

set_max_posts_per_page() 정적인 공개 메소드

static public set_max_posts_per_page ( integer $value )
$value integer