pfeifferNet

Grid
in package

Display a grid of cards.

Uses CSS grid.

Tags
since
1.7.0
since
5.5.0

Inherit standard singleton class.

since
5.11.0

Deprecated global singleton.

since
6.0.0

Refactor for newUI.

used-by
Term_Grid::__construct()
used-by
Member::__construct()

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
since
5.3.0

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
since
5.3.0

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
since
5.3.0

GRID_CONTAINER

Grid container partial filename.

protected string GRID_CONTAINER = 'grid-container.php'
Tags
since
5.3.0

IMAGE_SIZE

Card image size.

protected string IMAGE_SIZE = 'medium'
Tags
since
6.0.0

Properties

$card_container

Fully qualifed path to the grid card partial.

protected string $card_container = ''
Tags
since
5.0.0

$grid_container

Fully qualifed path to the grid container partial.

protected string $grid_container = ''
Tags
since
5.0.0

$instances

The array of instances of this class and sub-classes.

protected static array<string|int, object> $instances = array()
Tags
since
5.11.0

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
since
1.7.0
since
6.0.0

Refactor for newUI.

link
https://developer.wordpress.org/reference/functions/wp_get_attachment_image/
see
Grid::CARD_DEFAULTS
used-by
Chapter::get_chapter_cards()
used-by
Term_Archive::get_content()
used-by
Term_Grid::get_cards()
used-by
Member::get_cards()
Return values
string

The grid card markup.

get_instance()

Creates and/or returns the instance of this class.

public static get_instance() : object
Tags
since
5.11.0
Return values
object

The instance of this class.

__construct()

Initialise the class.

protected __construct() : void
Tags
since
1.7.0

        
On this page

Search results