load_default_widgets filter-hookWP 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.

Usage

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.
Default: true

Changelog

Since 2.8.0 Introduced.

Where the hook is called

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

Where the hook is used in WordPress

Usage not found.