Determines whether a given widget is displayed on the front end.
Description
Either $callback or $id_base can be used $id_base is the first argument when extending WP_Widget class Without the optional $widget_id parameter, returns the ID of the first sidebar in which the first instance of the widget with the given callback or $id_base is found.With the $widget_id parameter, returns the ID of the sidebar where the widget with that callback/$id_base AND that ID is found. NOTE: $widget_id and $id_base are the same for single widgets. To be effective this function has to run after widgets have initialized, at action 'init' or later. For more information on this and similar theme functions, check out the <a href="https://developer.wordpress.org/themes/basics/conditional-tags/">https://developer.wordpress.org/themes/basics/conditional-tags/</a> Conditional Tags article in the Theme Developer Handbook.
Parameters
$callbackcallable|falseoptional
Widget callback to check. Default false.Default: false
$widget_idstring|falseoptional
Widget ID. Optional, but needed for checking. Default false.Default: false
$id_basestring|falseoptional
The base ID of a widget created by extending WP_Widget. Default false.Default: false
$skip_inactivebooloptional
Whether to check in 'wp_inactive_widgets'. Default true.Default: true
Return
string|false
ID of the sidebar in which the widget is active, false if the widget is not active.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 6.7.7 tag, from src/wp-includes/widgets.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.