ClarksonCore

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
codeCoverageIgnore
Return values
mixed

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_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_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_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_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.

Return values
array<string|int, Clarkson_User>

        

Search results