WordPress at a glance
функция не описана

WP_Customize_Widgets::get_selective_refreshable_widgets() public WP 4.5.0

List whether each registered widget can be use selective refresh.

If the theme does not support the customize-selective-refresh-widgets feature, then this will always return an empty array.

It's a method of the class: WP_Customize_Widgets{}

Хуков нет.

Возвращает

Array. Mapping of id_base to support. If theme doesn't support selective refresh, an empty array is returned.

Использование

$WP_Customize_Widgets = new WP_Customize_Widgets();
$WP_Customize_Widgets->get_selective_refreshable_widgets();

Заметки

  • Global. WP_Widget_Factory. $wp_widget_factory

Changelog

Since 4.5.0 Introduced.

Код WP_Customize_Widgets::get_selective_refreshable_widgets() WP 5.5.1

<?php
public function get_selective_refreshable_widgets() {
	global $wp_widget_factory;
	if ( ! current_theme_supports( 'customize-selective-refresh-widgets' ) ) {
		return array();
	}
	if ( ! isset( $this->selective_refreshable_widgets ) ) {
		$this->selective_refreshable_widgets = array();
		foreach ( $wp_widget_factory->widgets as $wp_widget ) {
			$this->selective_refreshable_widgets[ $wp_widget->id_base ] = ! empty( $wp_widget->widget_options['customize_selective_refresh'] );
		}
	}
	return $this->selective_refreshable_widgets;
}