WPDev.one
Core Function
View Source on Trac ↗

is_active_widget()

is_active_widget( mixed $callback = false, mixed $widget_id = false, mixed $id_base = false, mixed $skip_inactive = true )

Determines whether a given widget is displayed on the front end.

Parameters 4 required

Name / Type Description
(callable

| false) $callback Optional. Widget callback to check. Default false.

Required
mixed

(string | false) $widget_id Optional. Widget ID. Optional, but needed for checking. Default false.

Required
mixed

(string | false) $id_base Optional. The base ID of a widget created by extending WP_Widget. Default false.

Required
bool

$skip_inactive Optional. Whether to check in 'wp_inactive_widgets'. Default true.

Required

Return Value

((string)
(string | false) ID of the sidebar in which the widget is active, false if the widget is not active.

Function Information

Since Version
2.2.0
Source File
wp-includes/widgets.php
Advertisement