Alert: 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.

WP_Theme_JSON_Resolver::remove_json_comments( array $input_array ): array

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


Parameters

$input_array array Required
The array to filter.

Top ↑

Return

array The filtered array.


Top ↑

Source

File: wp-includes/class-wp-theme-json-resolver.php. View all references

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;
}

Top ↑

Changelog

Changelog
Version Description
6.1.0 Introduced.

Top ↑

User Contributed Notes

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