PHP Class Jetpack_Widget_Conditions, jetpack

Mostra file Open project: automattic/jetpack Class Usage Examples

Public Properties

Property Type Description
$passed_template_redirect

Public Methods

Method Description
filter_widget ( array $instance ) : array Determine whether the widget should be displayed based on conditions set by the user.
generate_condition_key ( array $rule ) : string Generates a condition key based on the rule array
init ( )
maybe_get_split_term ( $old_term_id = '', $taxonomy = '' )
sidebars_widgets ( array $widget_areas ) : array Filter the list of widgets for a sidebar so that active sidebars work as expected.
strcasecmp_name ( $a, $b )
template_redirect ( )
widget_admin_setup ( )
widget_conditions_admin ( $widget, $return, array $instance ) Add the widget conditions to each widget in the admin.
widget_conditions_has_children ( ) This is the AJAX endpoint for the has_children input.
widget_conditions_has_children_echo ( $major = '', $minor = '', $has_children = false ) Provide an option to include children of pages.
widget_conditions_options ( ) This is the AJAX endpoint for the second level of conditions.
widget_conditions_options_echo ( $major = '', $minor = '' ) Provided a second level of granularity for widget conditions.
widget_update ( $instance, array $new_instance, array $old_instance ) : array On an AJAX update of the widget settings, process the display conditions.

Method Details

filter_widget() public static method

Determine whether the widget should be displayed based on conditions set by the user.
public static filter_widget ( array $instance ) : array
$instance array The widget settings.
return array Settings to display or bool false to hide.

generate_condition_key() static public method

Generates a condition key based on the rule array
static public generate_condition_key ( array $rule ) : string
$rule array
return string key used to retrieve the condition.

init() public static method

public static init ( )

maybe_get_split_term() public static method

public static maybe_get_split_term ( $old_term_id = '', $taxonomy = '' )

sidebars_widgets() public static method

Filter the list of widgets for a sidebar so that active sidebars work as expected.
public static sidebars_widgets ( array $widget_areas ) : array
$widget_areas array An array of widget areas and their widgets.
return array The modified $widget_area array.

strcasecmp_name() public static method

public static strcasecmp_name ( $a, $b )

template_redirect() public static method

public static template_redirect ( )

widget_admin_setup() public static method

public static widget_admin_setup ( )

widget_conditions_admin() public static method

Add the widget conditions to each widget in the admin.
public static widget_conditions_admin ( $widget, $return, array $instance )
$widget unused.
$return unused.
$instance array The widget settings.

widget_conditions_has_children() public static method

This is the AJAX endpoint for the has_children input.
public static widget_conditions_has_children ( )

widget_conditions_has_children_echo() public static method

Provide an option to include children of pages.
public static widget_conditions_has_children_echo ( $major = '', $minor = '', $has_children = false )

widget_conditions_options() public static method

This is the AJAX endpoint for the second level of conditions.
public static widget_conditions_options ( )

widget_conditions_options_echo() public static method

Provided a second level of granularity for widget conditions.
public static widget_conditions_options_echo ( $major = '', $minor = '' )

widget_update() public static method

On an AJAX update of the widget settings, process the display conditions.
public static widget_update ( $instance, array $new_instance, array $old_instance ) : array
$new_instance array New settings for this instance as input by the user.
$old_instance array Old settings for this instance.
return array Modified settings.

Property Details

$passed_template_redirect static_oe public_oe property

static public $passed_template_redirect