WP HOOKS
filtrod 6.8.0

should_load_block_assets_on_demand

Args 1Plik wp-includes/script-loader.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters whether block styles should be loaded on demand.

Returning false loads all block assets, regardless of whether they are rendered in a page or not. Returning true loads block assets only when they are rendered. The default value of the filter depends on the result of {@see \wp_should_load_separate_core_block_assets()}, which controls whether Core block stylesheets should be loaded separately or via a combined 'wp-block-library' stylesheet.

Parametry

ParametrTypOpis
$load_assets_on_demandboolWhether to load block assets only when they are rendered.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej
add_filter( 'should_load_block_assets_on_demand', 'twoja_funkcja' );

function twoja_funkcja($param_1) {
	// Twój kod
}

Popularne w tej kategorii