pfeifferNet

Gallery
in package

Display an album gallery as a grid of images.

The grid uses CSS columns. This will handle different aspect ration images. This provides a visually acceptable way to mix portrait and landscape images.

Tags
since
1.0.0
since
5.5.0

Inherit standard singleton class.

since
5.7.0

Standalone claass with limited pNet dependency.

since
5.11.0

Deprecate global singleton.

since
5.12.0

Refactor to support lightbox.

since
6.0.0

Refactor to improve handling of defaults.

since
6.0.0

Refactor for new UI.

since
6.2.0

Integrate pNet lightbox functionality.

Table of Contents

Constants

CARD_DEFAULTS  = array('image_id' => 0, 'itemprop' => 'AssociatedMedia', 'itemtype' => 'https://schema.org/ImageObject', 'metadata' => array(), 'url' => '')
Gallery item default attributes.
CONTAINER_DEFAULTS  = array('album' => '', 'itemprop' => '', 'itemtype' => 'https://schema.org/ImageGallery', 'metadata' => array())
Gallery container default attributes.
GALLERY_CONTAINER  = 'gallery-container.php'
Gallery container filename.
GALLERY_ITEM  = 'gallery-item.php'
Gallery item filename.
IMAGE_SIZE  = 'medium_large'
Gallery image size.

Properties

$album  : Album
The instance of the Album class.
$gallery_container  : string
The fully qualified path to gallery container partial.
$gallery_item_container  : string
The fully qualified path to gallery item partial.
$instances  : array<string|int, object>
The array of instances of this class and sub-classes.
$lightbox  : Lightbox
The instance of the Lightbox class.

Methods

get_instance()  : object
Creates and/or returns the instance of this class.
render()  : void
Render gallery image grid by album.
__construct()  : void
Initialise the class and set its properties.
get_cards()  : string
Return image cards.

Constants

CARD_DEFAULTS

Gallery item default attributes.

protected array<string|int, mixed> CARD_DEFAULTS = array('image_id' => 0, 'itemprop' => 'AssociatedMedia', 'itemtype' => 'https://schema.org/ImageObject', 'metadata' => array(), 'url' => '')

The default gallery item display default settings. @type int $image_id The attachment ID of the image. @type string $itemprop Schema.org itemprop value for the gallery item. @type string $itemtype URL of schema.org itemtype definition. @type string[] $metadata Array of itemprop key/value pairs for the gallery item. @type string $itemprop Schema.org itemprop key. @type string $content Schema.org itemprop value. @type string $url The URL for the full size, originally uploaded image.

Tags
since
6.0.0

CONTAINER_DEFAULTS

Gallery container default attributes.

protected array<string|int, mixed> CONTAINER_DEFAULTS = array('album' => '', 'itemprop' => '', 'itemtype' => 'https://schema.org/ImageGallery', 'metadata' => array())

The default gallery display default settings. @type string $album The album taxonomy slug. @type string $itemtype URL of schema.org itemtype definition. @type string $itemprop Schema.org itemprop value for the gallery container. @type string[] $metadata Array of itemprop key/value pairs for the container. @type string $itemprop Schema.org itemprop key. @type string $content Schema.org itemprop value.

Tags
since
5.7.0
since
6.0.0

Split into gallery container and gallery item defaults.

Gallery container filename.

protected string GALLERY_CONTAINER = 'gallery-container.php'
Tags
since
1.0.0

Gallery item filename.

protected string GALLERY_ITEM = 'gallery-item.php'
Tags
since
1.0.0

IMAGE_SIZE

Gallery image size.

protected string IMAGE_SIZE = 'medium_large'
Tags
since
1.0.0

Properties

The fully qualified path to gallery container partial.

protected string $gallery_container
Tags
since
1.0.0

The fully qualified path to gallery item partial.

protected string $gallery_item_container
Tags
since
1.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_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.

render()

Render gallery image grid by album.

public render([array<string|int, mixed> $args = array() ]) : void
Parameters
$args : array<string|int, mixed> = array()

An array of arguments for the gallery.

Tags
since
1.0.0
since
5.12.0

Refactor to support lightbox.

since
6.0.0

Refactor to improve handling of defaults.

see
Gallery::CONTAINER_DEFAULTS
used-by
Gallery::the_content()

__construct()

Initialise the class and set its properties.

protected __construct() : void
Tags
since
1.0.0
uses
Album
uses
Lightbox

get_cards()

Return image cards.

protected get_cards([array<string|int, mixed> $args = array() ]) : string
Parameters
$args : array<string|int, mixed> = array()

The display attributes.

Tags
since
6.0.0
uses
Album::get_content()
see
Gallery::CARD_DEFAULTS
Return values
string

The image cards markup, or empty string if a problem.


        
On this page

Search results