Member
in package
Provides member information and functionality.
A member is a user who has author or higher role. Does not include administrator.
Tags
Table of Contents
Constants
- ABOUT_IMAGE_KEY = 'psite_about_image'
- Define about image key name.
- ABOUT_IMAGE_SIZE = 'medium'
- Define about image display size.
- CARD_DEFAULTS = array('card_level' => 2, 'description' => '', 'image_id' => 0, 'itemprop' => '', 'itemtype' => 'https://schema.org/Person', 'metadata' => array(), 'name' => '', 'new_tab' => false, 'url' => '')
- The default grid card display attributes.
- CONTAINER_DEFAULTS = array('itemprop' => '', 'itemtype' => '', 'metadata' => array())
- The default grid container display attributes.
- USER_ROLES = array('author', 'editor')
- User roles to determine member status.
Properties
- $grid : Grid
- The instance of the Grid class.
- $instances : array<string|int, object>
- The array of instances of this class and sub-classes.
- $link_list : Link_List
- The instance of the Link_List class.
Methods
- __construct() : void
- Initialise the class and set its properties.
- get_instance() : object
- Creates and/or returns the instance of this class.
- render_grid() : void
- Render list of members as a grid of cards.
- render_links() : void
- Render list of members as links to home pages.
- get_cards() : string
- Return member cards.
- get_members() : array<string|int, WP_User>
- Get the array of members.
Constants
ABOUT_IMAGE_KEY
Define about image key name.
protected
string
ABOUT_IMAGE_KEY
= 'psite_about_image'
Tags
ABOUT_IMAGE_SIZE
Define about image display size.
protected
string
ABOUT_IMAGE_SIZE
= 'medium'
Tags
CARD_DEFAULTS
The default grid card display attributes.
protected
array<string|int, mixed>
CARD_DEFAULTS
= array('card_level' => 2, 'description' => '', 'image_id' => 0, 'itemprop' => '', 'itemtype' => 'https://schema.org/Person', 'metadata' => array(), 'name' => '', 'new_tab' => false, 'url' => '')
CARD_DEFAULTS { Default values for grid card. @type int $card_level Heading level to apply to card name (defaults to paragraph if not set). @type string $description Short description of the member. @type int $image_id The attachment ID of the image. @type string $itemprop Schema.org itemprop value for the card. @type string $itemtype URL of schema.org itemtype definition. @type array $metadata Array of itemprop key/value pairs for the card @type string $name Name of member. Used for title. @type bool $new_tab Open URL in new tab flag. @type string $url The URL the card points to. }
Tags
CONTAINER_DEFAULTS
The default grid container display attributes.
protected
array<string|int, mixed>
CONTAINER_DEFAULTS
= array('itemprop' => '', 'itemtype' => '', 'metadata' => array())
CONTAINER_DEFAULTS { Default values for card grid container. @type string $itemprop Schema.org itemprop value for the container. @type string $itemtype URL of schema.org itemtype definition. @type array $metatdata Array of itemprop key/value pairs for the container. }
Tags
USER_ROLES
User roles to determine member status.
protected
string
USER_ROLES
= array('author', 'editor')
Tags
Properties
$grid
The instance of the Grid class.
protected
Grid
$grid
Tags
$instances
The array of instances of this class and sub-classes.
protected
static array<string|int, object>
$instances
= array()
Tags
$link_list
The instance of the Link_List class.
protected
Link_List
$link_list
Tags
Methods
__construct()
Initialise the class and set its properties.
public
__construct() : void
Tags
get_instance()
Creates and/or returns the instance of this class.
public
static get_instance() : object
Tags
Return values
object —The instance of this class.
render_grid()
Render list of members as a grid of cards.
public
render_grid([array<string|int, mixed> $args = array() ]) : void
Parameters
- $args : array<string|int, mixed> = array()
-
Display attributes.
Tags
render_links()
Render list of members as links to home pages.
public
render_links() : void
Tags
get_cards()
Return member cards.
protected
get_cards([array<string|int, mixed> $args = array() ]) : string
Parameters
- $args : array<string|int, mixed> = array()
-
The display attributes.
Tags
Return values
stringget_members()
Get the array of members.
protected
get_members() : array<string|int, WP_User>
Tags
Return values
array<string|int, WP_User> —An array of WP_User objects