Constants

THUMB_SIZE

THUMB_SIZE

DEFAULT_WIDTH

DEFAULT_WIDTH

Properties

$_instance_width

$_instance_width

Methods

__construct()

__construct()

widget()

widget(array $args, array $instance)

Parameters

array $args

Display arguments including before_title, after_title, before_widget, and after_widget.

array $instance

The settings for the particular instance of the widget

get_attachments()

get_attachments(array $instance) : array

Fetch the images attached to the gallery Widget

Parameters

array $instance

The Widget instance for which you'd like attachments

Returns

array —

Array of attachment objects for the Widget in $instance

rectangular_widget()

rectangular_widget(array $args, array $instance) : string

Generate HTML for a rectangular, tiled Widget

Parameters

array $args

Display arguments including before_title, after_title, before_widget, and after_widget.

array $instance

The Widget instance to generate HTML for

Returns

string —

String of HTML representing a rectangular gallery

square_widget()

square_widget(array $args, array $instance) : string

Generate HTML for a square (grid style) Widget

Parameters

array $args

Display arguments including before_title, after_title, before_widget, and after_widget.

array $instance

The Widget instance to generate HTML for

Returns

string —

String of HTML representing a square gallery

circle_widget()

circle_widget(array $args, array $instance) : string

Generate HTML for a circular (grid style) Widget

Parameters

array $args

Display arguments including before_title, after_title, before_widget, and after_widget.

array $instance

The Widget instance to generate HTML for

Returns

string —

String of HTML representing a circular gallery

slideshow_widget()

slideshow_widget(array $args, array $instance) : string

Generate HTML for a slideshow Widget

Parameters

array $args

Display arguments including before_title, after_title, before_widget, and after_widget.

array $instance

The Widget instance to generate HTML for

Returns

string —

String of HTML representing a slideshow gallery

tiled_gallery_content_width()

tiled_gallery_content_width(int $width) : int

tiled_gallery_content_width filter

Used to adjust the content width of Jetpack_Tiled_Gallery's in sidebars

$this->_instance_width is filtered in widget() and this filter is added then removed in widget()

Parameters

int $width

int The original width value

Returns

int —

The filtered width

form()

form( $instance)

Parameters

$instance

update()

update( $new_instance,  $old_instance)

Parameters

$new_instance
$old_instance

sanitize()

sanitize(array $instance) : array

Sanitize the $instance's values to the set of allowed values. If a value is not acceptable, it is set to its default.

Helps keep things nice and secure by whitelisting only allowed values

Parameters

array $instance

The Widget instance to sanitize values for

Returns

array —

$instance The Widget instance with values sanitized

allowed_values()

allowed_values() : array

Return a multi-dimensional array of allowed values (and their labels) for all widget form elements

To allow all values on an input, omit it from the returned array

Returns

array —

Array of allowed values for each option

defaults()

defaults() : array

Return an associative array of default values

These values are used in new widgets as well as when sanitizing input. If a given value is not allowed, as defined in allowed_values(), that input is set to the default value defined here.

Returns

array —

Array of default values for the Widget's options

enqueue_frontend_scripts()

enqueue_frontend_scripts()

admin_init()

admin_init()