You are here

function panels_switcher_switch in Panels 6.2

Same name and namespace in other branches
  1. 5.2 includes/plugins.inc \panels_switcher_switch()

Switch one object for another just prior to load.

Parameters

$plugin: The name or loaded plugin to delegate switching to.

$type: The object type. eg, 'panels_page', 'panels_mini', etc.

$name: The name of the object that might be switched.

$candidates: A list of possible objects to switch to. The data conforms to what was set in the settings, and is keyed to the panel.

Return value

The object to switch to. NULL if electing not to switch.

1 call to panels_switcher_switch()
_panels_page_check_switchers in panels_page/panels_page.render.inc

File

includes/plugins.inc, line 1284
plugins.inc

Code

function panels_switcher_switch($plugin, $type, $name, $candidates) {
  $function = panels_plugin_get_function('switchers', $plugin, 'switch');
  if ($function) {
    return $function($type, $name, $candidates);
  }
}