PHP Class Jetpack_Gallery_Widget, jetpack

Version: 1.0 Author URI: http://automattic.com
Inheritance: extends WP_Widget
Datei anzeigen Open project: automattic/jetpack

Protected Properties

Property Type Description
$_instance_width

Public Methods

Method Description
__construct ( )
allowed_values ( ) : array Return a multi-dimensional array of allowed values (and their labels) for all widget form elements
circle_widget ( array $args, array $instance ) : string Generate HTML for a circular (grid style) Widget
defaults ( ) : array Return an associative array of default values
enqueue_admin_scripts ( )
enqueue_frontend_scripts ( )
form ( $instance )
get_attachments ( array $instance ) : array Fetch the images attached to the gallery Widget
rectangular_widget ( array $args, array $instance ) : string Generate HTML for a rectangular, tiled Widget
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.
slideshow_widget ( array $args, array $instance ) : string Generate HTML for a slideshow Widget
square_widget ( array $args, array $instance ) : string Generate HTML for a square (grid style) Widget
tiled_gallery_content_width ( integer $width ) : integer tiled_gallery_content_width filter
update ( $new_instance, $old_instance )
widget ( array $args, array $instance )

Method Details

__construct() public method

public __construct ( )

allowed_values() public method

To allow all values on an input, omit it from the returned array
public allowed_values ( ) : array
return array Array of allowed values for each option

circle_widget() public method

Generate HTML for a circular (grid style) Widget
public circle_widget ( array $args, array $instance ) : string
$args array Display arguments including before_title, after_title, before_widget, and after_widget.
$instance array The Widget instance to generate HTML for
return string String of HTML representing a circular gallery

defaults() public method

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.
public defaults ( ) : array
return array Array of default values for the Widget's options

enqueue_admin_scripts() public method

enqueue_frontend_scripts() public method

form() public method

public form ( $instance )

get_attachments() public method

Fetch the images attached to the gallery Widget
public get_attachments ( array $instance ) : array
$instance array The Widget instance for which you'd like attachments
return array Array of attachment objects for the Widget in $instance

rectangular_widget() public method

Generate HTML for a rectangular, tiled Widget
public rectangular_widget ( array $args, array $instance ) : string
$args array Display arguments including before_title, after_title, before_widget, and after_widget.
$instance array The Widget instance to generate HTML for
return string String of HTML representing a rectangular gallery

sanitize() public method

Helps keep things nice and secure by whitelisting only allowed values
public sanitize ( array $instance ) : array
$instance array The Widget instance to sanitize values for
return array $instance The Widget instance with values sanitized

slideshow_widget() public method

Generate HTML for a slideshow Widget
public slideshow_widget ( array $args, array $instance ) : string
$args array Display arguments including before_title, after_title, before_widget, and after_widget.
$instance array The Widget instance to generate HTML for
return string String of HTML representing a slideshow gallery

square_widget() public method

Generate HTML for a square (grid style) Widget
public square_widget ( array $args, array $instance ) : string
$args array Display arguments including before_title, after_title, before_widget, and after_widget.
$instance array The Widget instance to generate HTML for
return string String of HTML representing a square gallery

update() public method

public update ( $new_instance, $old_instance )

widget() public method

public widget ( array $args, array $instance )
$args array Display arguments including before_title, after_title, before_widget, and after_widget.
$instance array The settings for the particular instance of the widget.

Property Details

$_instance_width protected_oe property

protected $_instance_width