GV\Widget_Collection
A collection of \GV\Widget objects.
Source: future/includes/class-gv-collection-widget.php:13
Details
- Kind:
class - Namespace:
GV - Extends:
Collection - Implements:
Collection_Position_Aware
Methods
| Method | Description |
|---|---|
add() | Add a \GV\Widet to this collection. |
get() | Get a \GV\Widget from this list by UID. |
by_position() | Get a copy of this \GV\Widget_Collection filtered by position. |
by_id() | Get a copy of this \GV\Widget_Collection filtered by ID. |
from_configuration() | Parse a configuration array into a Widget_Collection. |
as_configuration() | Return a configuration array for this widget collection. |
Method Reference
add()
public function add( $widget )
Add a \GV\Widet to this collection.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$widget | \GV\Widget | The widget to add to the internal array. |
Returns
void
Since: 2.0
Source: future/includes/class-gv-collection-widget.php:23
get()
public function get( $widget_uid )
Get a \GV\Widget from this list by UID.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$widget_uid | int | The UID of the widget in the collection to get. |
Returns
- \GV\Widget |
null— The \GV\Widget with the $widget_uid as the UID, or null if not found.
Since: 2.0
Source: future/includes/class-gv-collection-widget.php:41
by_position()
public function by_position( $position )
Get a copy of this \GV\Widget_Collection filtered by position.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$position | string | The position to get the widgets for. Can be a wildcard * |
Returns
- \GV\Widget_Collection — A filtered collection of \GV\Widget, filtered by position.
Source: future/includes/class-gv-collection-widget.php:61
by_id()
public function by_id( $id )
Get a copy of this \GV\Widget_Collection filtered by ID.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$id | string | The IDs to get the widgets for. |
Returns
- \GV\Widget_Collection — A filtered collection of \GV\Widget, filtered by ID.
Source: future/includes/class-gv-collection-widget.php:84
from_configuration()
public static function from_configuration( $configuration )
Parse a configuration array into a Widget_Collection.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$configuration | array | The configuration, structured like so: array( [other zones] 'footer_right' => array( [other widgets] '5372653f25d44' => array( |
Returns
- \GV\Widget_Collection — A collection of widgets.
See Also
\GV\Widget::as_configuration() for structure ) [other widgets] ) [other zones] )
Source: future/includes/class-gv-collection-widget.php:120
as_configuration()
public function as_configuration()
Return a configuration array for this widget collection.
Returns
array— See \GV\Widget_Collection::from_configuration() for structure.
Source: future/includes/class-gv-collection-widget.php:147