WP_Theme_JSON_Resolver::remove_json_comments()private staticWP 1.0

When given an array, this will remove any keys with the name //.

{} Это метод класса: WP_Theme_JSON_Resolver{}

Хуков нет.

Возвращает

Массив. The filtered array.

Использование

$result = WP_Theme_JSON_Resolver::remove_json_comments( $array );
$array(массив) (обязательный)
The array to filter.

Код WP_Theme_JSON_Resolver::remove_json_comments() WP 6.1.1

private static function remove_json_comments( $array ) {
	unset( $array['//'] );
	foreach ( $array as $k => $v ) {
		if ( is_array( $v ) ) {
			$array[ $k ] = static::remove_json_comments( $v );
		}
	}

	return $array;
}