WP_Theme_JSON_Resolver::remove_json_comments( array $input_array ): array

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

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

Parameters

$input_arrayarrayrequired
The array to filter.

Return

array The filtered array.

Source

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

	return $input_array;
}

Changelog

VersionDescription
6.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.