akcjaod 3.0.0
dynamic_sidebar
Opis — z kodu źródłowego
Fires before a widget's display callback is called.
Note: The action fires on both the front end and back end, including for widgets in the Inactive Widgets sidebar on the Widgets screen. The action is not fired for empty sidebars.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$widget | array | { An associative array of widget arguments. @type string $name Name of the widget. @type string $id Widget ID. @type callable $callback When the hook is fired on the front end, <code>$callback</code> is an array containing the widget object. Fired on the back end, <code>$callback</code> is 'wp_widget_control', see <code>$_callback</code>. @type array $params An associative array of multi-widget arguments. @type string $classname CSS class applied to the widget container. @type string $description The widget description. @type array $_callback When the hook is fired on the back end, <code>$_callback</code> is populated with an array containing the widget object, see <code>$callback</code>. } |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej
add_action( 'dynamic_sidebar', 'twoja_funkcja' );
function twoja_funkcja($param_1) {
// Twój kod
}
// rejestracja funkcji zwrotnej
add_action( 'dynamic_sidebar', 'twoja_funkcja' );
function twoja_funkcja($param_1) {
// Twój kod
}Popularne w tej kategorii