WP_Theme_JSON_Resolver::remove_json_comments()
When given an array, this will remove any keys with the name //.
Method of the class: WP_Theme_JSON_Resolver{}
No Hooks.
Return
Array
. The filtered array.
Usage
$result = WP_Theme_JSON_Resolver::remove_json_comments( $array );
- $array(array) (required)
- The array to filter.
WP_Theme_JSON_Resolver::remove_json_comments() WP Theme JSON Resolver::remove json comments code 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; }