\Jetpack_Widget_Conditions

Hide or show widgets conditionally.

Summary

Methods
Properties
Constants
init()
widget_admin_setup()
widget_conditions_options_echo()
widget_conditions_options()
widget_conditions_admin()
widget_update()
sidebars_widgets()
filter_widget()
strcasecmp_name()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

init()

init()

widget_admin_setup()

widget_admin_setup()

widget_conditions_options_echo()

widget_conditions_options_echo( $major,  $minor)

Provided a second level of granularity for widget conditions.

Parameters

$major
$minor

widget_conditions_options()

widget_conditions_options()

This is the AJAX endpoint for the second level of conditions.

widget_conditions_admin()

widget_conditions_admin(mixed $widget, mixed $return, array $instance)

Add the widget conditions to each widget in the admin.

Parameters

mixed $widget

unused.

mixed $return

unused.

array $instance

The widget settings.

widget_update()

widget_update( $instance, array $new_instance, array $old_instance) : array

On an AJAX update of the widget settings, process the display conditions.

Parameters

$instance
array $new_instance

New settings for this instance as input by the user.

array $old_instance

Old settings for this instance.

Returns

array —

Modified settings.

sidebars_widgets()

sidebars_widgets(array $widget_areas) : array

Filter the list of widgets for a sidebar so that active sidebars work as expected.

Parameters

array $widget_areas

An array of widget areas and their widgets.

Returns

array —

The modified $widget_area array.

filter_widget()

filter_widget(array $instance) : array

Determine whether the widget should be displayed based on conditions set by the user.

Parameters

array $instance

The widget settings.

Returns

array —

Settings to display or bool false to hide.

strcasecmp_name()

strcasecmp_name( $a,  $b)

Parameters

$a
$b