wp_filter_out_block_nodes()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
wp_filter_out_block_nodes( $nodes ): array<array<string,
Описание
Этот фильтр удаляет из массива все блоки.
Мы хотим, чтобы WP_Theme_JSON не знал о деталях того, как используется CSS.
Этот фильтр позволяет изменять вывод WP_Theme_JSON в зависимости от того, загружаем ли мы раздельные ресурсы, не сообщая классу об этой детали.
Оригинал (английский)
This particular filter removes all of the blocks from the array.
We want WP_Theme_JSON to be ignorant of the implementation details of how the CSS is being used.
This filter allows us to modify the output of WP_Theme_JSON depending on whether or not we are loading separate assets, without making the class aware of that detail.
Возвращаемое значение
array<array<string,
Исходный код
wp-includes/script-loader.php:2533
function wp_filter_out_block_nodes( $nodes ) {
return array_filter(
$nodes,
static function ( $node ) {
return ! in_array( 'blocks', $node['path'], true );
},
ARRAY_FILTER_USE_BOTH
);
}
История изменений
| Версия | Описание |
|---|---|
| 6.1.0 | Introduced. |

