Objects
in package
This class is used to convert WordPress posts, terms and users into Clarkson Objects.
Table of Contents
- OBJECT_CLASS_NAMESPACE = '\\Clarkson_Core\\WordPress_Object\\'
- __wakeup() : mixed
- Wakeup.
- get_instance() : Objects
- Get the instance.
- get_object() : Clarkson_Object
- Get post that's converted to their corresponding WordPress object class.
- get_objects() : array<string|int, Clarkson_Object>
- Get an array of posts converted to their corresponding WordPress object class.
- get_post_type() : Clarkson_Post_Type
- Get post type object by post type.
- get_post_types() : array<string|int, Clarkson_Post_Type>
- Get an array of post types converted from their corresponding WordPress post type class.
- get_role() : Clarkson_Role
- Get Clarkson role object by WordPress role object.
- get_roles() : array<string|int, Clarkson_Role>
- Get an array of roles converted from their corresponding WordPress role class.
- get_taxonomies() : array<string|int, Clarkson_Taxonomy>
- Get an array of taxonomies converted from their corresponding WordPress taxonomy class.
- get_taxonomy() : Clarkson_Taxonomy
- Get taxonomy object by taxonomy.
- get_template() : Clarkson_Template
- get_templates() : array<string|int, Clarkson_Template>
- Get an array of posts converted to their corresponding WordPress template class.
- get_term() : Clarkson_Term
- Get term data.
- get_terms() : array<string|int, Clarkson_Term>
- Convert WP_Term object to a Clarkson Object.
- get_user() : Clarkson_User
- Get user by user id.
- get_users() : array<string|int, Clarkson_User>
- Convert WP_User object to a Clarkson Object.
Constants
OBJECT_CLASS_NAMESPACE
public
mixed
OBJECT_CLASS_NAMESPACE
= '\\Clarkson_Core\\WordPress_Object\\'
Methods
__wakeup()
Wakeup.
public
__wakeup() : mixed
Tags
Return values
mixed —get_instance()
Get the instance.
public
static get_instance() : Objects
Return values
Objects —get_object()
Get post that's converted to their corresponding WordPress object class.
public
get_object(WP_Post $post) : Clarkson_Object
Parameters
- $post : WP_Post
-
Post.
Return values
Clarkson_Object —Clarkson Post object.
get_objects()
Get an array of posts converted to their corresponding WordPress object class.
public
get_objects(array<string|int, WP_Post> $posts) : array<string|int, Clarkson_Object>
Parameters
- $posts : array<string|int, WP_Post>
-
Posts.
Return values
array<string|int, Clarkson_Object> —$objects Array of post objects.
get_post_type()
Get post type object by post type.
public
get_post_type(WP_Post_Type $post_type) : Clarkson_Post_Type
Parameters
- $post_type : WP_Post_Type
Return values
Clarkson_Post_Type —get_post_types()
Get an array of post types converted from their corresponding WordPress post type class.
public
get_post_types(array<string|int, WP_Post_Type> $post_types) : array<string|int, Clarkson_Post_Type>
Parameters
- $post_types : array<string|int, WP_Post_Type>
-
WordPress post type objects
Return values
array<string|int, Clarkson_Post_Type> —$objects Array of Clarkson post type objects.
get_role()
Get Clarkson role object by WordPress role object.
public
get_role(WP_Role $role) : Clarkson_Role
Parameters
- $role : WP_Role
Return values
Clarkson_Role —get_roles()
Get an array of roles converted from their corresponding WordPress role class.
public
get_roles(array<string|int, WP_Role> $roles) : array<string|int, Clarkson_Role>
Parameters
- $roles : array<string|int, WP_Role>
-
Array of WordPress role objects.
Return values
array<string|int, Clarkson_Role> —$objects Array of post objects.
get_taxonomies()
Get an array of taxonomies converted from their corresponding WordPress taxonomy class.
public
get_taxonomies(array<string|int, WP_Taxonomy> $taxonomies) : array<string|int, Clarkson_Taxonomy>
Parameters
- $taxonomies : array<string|int, WP_Taxonomy>
-
WordPress taxonomy objects
Return values
array<string|int, Clarkson_Taxonomy> —$objects Array of Clarkson taxonomy objects.
get_taxonomy()
Get taxonomy object by taxonomy.
public
get_taxonomy(WP_Taxonomy $taxonomy) : Clarkson_Taxonomy
Parameters
- $taxonomy : WP_Taxonomy
Return values
Clarkson_Taxonomy —get_template()
public
get_template(WP_Post $post) : Clarkson_Template
Parameters
- $post : WP_Post
Return values
Clarkson_Template —get_templates()
Get an array of posts converted to their corresponding WordPress template class.
public
get_templates(array<string|int, WP_Post> $posts) : array<string|int, Clarkson_Template>
Parameters
- $posts : array<string|int, WP_Post>
-
Posts.
Return values
array<string|int, Clarkson_Template> —$objects Array of post templates.
get_term()
Get term data.
public
get_term(WP_Term $term) : Clarkson_Term
Parameters
- $term : WP_Term
-
The term.
Return values
Clarkson_Term —get_terms()
Convert WP_Term object to a Clarkson Object.
public
get_terms(array<string|int, WP_Term> $terms) : array<string|int, Clarkson_Term>
Parameters
- $terms : array<string|int, WP_Term>
-
array of \WP_Term objects.
Return values
array<string|int, Clarkson_Term> —get_user()
Get user by user id.
public
get_user(WP_User $user) : Clarkson_User
Parameters
- $user : WP_User
-
WP_User object.
Return values
Clarkson_User —get_users()
Convert WP_User object to a Clarkson Object.
public
get_users(array<string|int, WP_User> $users) : array<string|int, Clarkson_User>
Parameters
- $users : array<string|int, WP_User>
-
array of \WP_User objects.