load_default_widgets
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 | Введена. |
Где вызывается хук
load_default_widgets
wp-includes/functions.php 5437
if ( ! apply_filters( 'load_default_widgets', true ) ) {