PHP Class WPLib_Post_Module_Base, wplib

Inheritance: extends WPLib_Module_Base
Show file Open project: wplib/wplib

Public Methods

Method Description
attach_taxonomy ( string $taxonomy ) Allows a post type to attach a taxonomy that is registered by someone else's code.
get_list ( array | string | WPLib_Query $query = [], array $args = [] ) : WPLib_Post_List_Default[]
get_query ( array $args = [] ) : WPLib_Query Query the posts. Equivalent to creating a new WP_Query which both instantiates and queries the DB.
instance_class ( ) : mixed | null
is_singular ( ) : boolean Determines if the current query's object is a singular post URL of the calling classes' post type.
register_post_type ( array $args = [] ) Register the post type inside of an Item classes' on_load() method.
register_post_type_labels ( array $args = [] ) : array Register the labels used for this post_type.
remove_post_type_support ( string[] $to_remove ) List post type support values given a list of values to support.

Method Details

attach_taxonomy() static public method

Allows a post type to attach a taxonomy that is registered by someone else's code.
static public attach_taxonomy ( string $taxonomy )
$taxonomy string

get_list() static public method

static public get_list ( array | string | WPLib_Query $query = [], array $args = [] ) : WPLib_Post_List_Default[]
$query array | string | WPLib_Query
$args array { @type string $list_class The specific class for the list, i.e. WPLib_Post_List @type string $default_list The default list if no $list_class, i.e. WPLib_Post_List_Default @type string $items The array of items, or a callable that will return a list of items. @type string $list_owner The class "owning" the list, typically "Owner" if Owner::get_list() @type string $instance_class The class for items in the list, i.e. WP_Post @type string $queried 'local' or 'queried' }
return WPLib_Post_List_Default[]

get_query() static public method

Query the posts. Equivalent to creating a new WP_Query which both instantiates and queries the DB.
static public get_query ( array $args = [] ) : WPLib_Query
$args array
return WPLib_Query

instance_class() static public method

static public instance_class ( ) : mixed | null
return mixed | null

is_singular() static public method

Determines if the current query's object is a singular post URL of the calling classes' post type.
static public is_singular ( ) : boolean
return boolean

register_post_type() static public method

Register the post type inside of an Item classes' on_load() method.
static public register_post_type ( array $args = [] )
$args array

register_post_type_labels() static public method

Register the labels used for this post_type.
static public register_post_type_labels ( array $args = [] ) : array
$args array
return array

remove_post_type_support() static public method

Typically needed for 'post' and 'page'.
static public remove_post_type_support ( string[] $to_remove )
$to_remove string[]