Grid
in package
Display a grid of cards.
Uses CSS grid.
Tags
Table of Contents
Constants
- CARD_CONTAINER = 'card-container.php'
- Grid card partial filename.
- CARD_DEFAULTS = array('allowed_tags' => array('i', 'em'), 'card_level' => 3, 'classes' => 'pnet-card', 'description' => '', 'image_id' => 0, 'itemprop' => '', 'itemtype' => 'https://schema.org/CreativeWork', 'metadata' => array(), 'name' => '', 'new_tab' => false, 'url' => '')
- The default grid card display attributes.
- CONTAINER_DEFAULTS = array('classes' => '', 'itemprop' => '', 'itemtype' => '', 'metadata' => array())
- The default grid container display attributes.
- GRID_CONTAINER = 'grid-container.php'
- Grid container partial filename.
- IMAGE_SIZE = 'medium'
- Card image size.
Properties
- $card_container : string
- Fully qualifed path to the grid card partial.
- $grid_container : string
- Fully qualifed path to the grid container partial.
- $instances : array<string|int, object>
- The array of instances of this class and sub-classes.
Methods
- get_card() : string
- Return grid card markup.
- get_instance() : object
- Creates and/or returns the instance of this class.
- render() : void
- Render the grid.
- __construct() : void
- Initialise the class.
Constants
CARD_CONTAINER
Grid card partial filename.
protected
string
CARD_CONTAINER
= 'card-container.php'
Tags
CARD_DEFAULTS
The default grid card display attributes.
protected
array<string|int, mixed>
CARD_DEFAULTS
= array('allowed_tags' => array('i', 'em'), 'card_level' => 3, 'classes' => 'pnet-card', 'description' => '', 'image_id' => 0, 'itemprop' => '', 'itemtype' => 'https://schema.org/CreativeWork', 'metadata' => array(), 'name' => '', 'new_tab' => false, 'url' => '')
CARD_DEFAULTS { Default values for grid card. @type array $allowed_tags Allowed HTML tags for card description. @type int $card_level Heading level to apply to card name (defaults to paragraph if not set). @type string $classes The CSS classes for the card. @type string $description Short description of item contents. @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 item. Used for title. @type bool $new_tab Open URL in new tab flag. @type string $url URL card points to. }
Tags
CONTAINER_DEFAULTS
The default grid container display attributes.
protected
array<string|int, mixed>
CONTAINER_DEFAULTS
= array('classes' => '', 'itemprop' => '', 'itemtype' => '', 'metadata' => array())
CONTAINER_DEFAULTS { Default values for card grid container. @type string $classes CSS classes to apply to 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
GRID_CONTAINER
Grid container partial filename.
protected
string
GRID_CONTAINER
= 'grid-container.php'
Tags
IMAGE_SIZE
Card image size.
protected
string
IMAGE_SIZE
= 'medium'
Tags
Properties
$card_container
Fully qualifed path to the grid card partial.
protected
string
$card_container
= ''
Tags
$grid_container
Fully qualifed path to the grid container partial.
protected
string
$grid_container
= ''
Tags
$instances
The array of instances of this class and sub-classes.
protected
static array<string|int, object>
$instances
= array()
Tags
Methods
get_card()
Return grid card markup.
public
get_card([array<string|int, mixed> $args = array() ]) : string
Parameters
- $args : array<string|int, mixed> = array()
-
Array of display arguments.
Tags
Return values
string —The grid card markup.
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()
Render the grid.
public
render([array<string|int, mixed> $args = array() ][, string $grid_items = '' ]) : void
Parameters
- $args : array<string|int, mixed> = array()
-
Array of display arguments.
- $grid_items : string = ''
-
Grid items markup.
Tags
__construct()
Initialise the class.
protected
__construct() : void