You are here

function widgets_element_load in Widgets 7

Load a single widget.

Parameters

$wid: The widget element ID.

$set_name: The widget set name.

$include: If set, this loader will restrict to a specific type of widget set.

Return value

An widget element array, consisting of the following keys:

  • "wid": The unique widget element ID.
  • "wsid": The unique widget set ID that contains this widget element.
  • "weight": The weight of this widget element within the widget set.
  • "name": The name of the element definition that powers this widget element.
  • "data": An array of configuration options for this widget element.

Besides these keys, the entirety of the widget definition is merged into the widget element array. Returns FALSE if the specified element cannot be found.

See also

widgets_set_load()

widgets_element_definition_load()

2 calls to widgets_element_load()
widgets_element_load_by_admin_path in ./widgets.module
widgets_help in ./widgets.module
Implements hook_help().

File

./widgets.module, line 936
Exposes global functionality for creating widget sets.

Code

function widgets_element_load($wid, $set_name, $include = NULL) {
  if (($set = widgets_set_load($set_name, NULL, $include)) && isset($set['elements'][$wid])) {
    return $set['elements'][$wid];
  }
  return FALSE;
}