load_default_widgets хук-фильтрWP 2.8.0

Filters whether to load the Widgets library.

Returning a falsey value from the filter will effectively short-circuit the Widgets library from loading.

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

add_filter( 'load_default_widgets', 'wp_kama_load_default_widgets_filter' );

/**
 * Function for `load_default_widgets` filter-hook.
 * 
 * @param bool $wp_maybe_load_widgets Whether to load the Widgets library.
 *
 * @return bool
 */
function wp_kama_load_default_widgets_filter( $wp_maybe_load_widgets ){

	// filter...
	return $wp_maybe_load_widgets;
}
$wp_maybe_load_widgets(true|false)
Whether to load the Widgets library.
По умолчанию: true

Список изменений

С версии 2.8.0 Введена.

Где вызывается хук

wp_maybe_load_widgets()
load_default_widgets
wp-includes/functions.php 5376
if ( ! apply_filters( 'load_default_widgets', true ) ) {

Где используется хук в WordPress

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