WP HOOKS
filtrod 5.8.0

should_load_separate_core_block_assets

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

Opis — z kodu źródłowego

Filters whether block styles should be loaded separately.

Returning false loads all core block assets, regardless of whether they are rendered in a page or not. Returning true loads core block assets only when they are rendered.

Parametry

ParametrTypOpis
$load_separate_assetsboolWhether separate assets will be loaded. Default false (all block assets are loaded, even when not used).

Wywołanie

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

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

Popularne w tej kategorii