Title: WP_Theme_JSON::remove_indirect_properties
Published: March 29, 2023
Last modified: February 24, 2026

---

# WP_Theme_JSON::remove_indirect_properties( array $input, array $output )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_theme_json/remove_indirect_properties/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/classes/wp_theme_json/remove_indirect_properties/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_theme_json/remove_indirect_properties/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_theme_json/remove_indirect_properties/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_theme_json/remove_indirect_properties/?output_format=md#wp--skip-link--target)

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

Removes indirect properties from the given input node and sets in the given output
node.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_theme_json/remove_indirect_properties/?output_format=md#parameters)󠁿

 `$input`arrayrequired

Node to process.

`$output`arrayrequired

The processed node. Passed by reference.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_theme_json/remove_indirect_properties/?output_format=md#source)󠁿

    ```php
    private static function remove_indirect_properties( $input, &$output ) {
    	foreach ( static::INDIRECT_PROPERTIES_METADATA as $property => $paths ) {
    		foreach ( $paths as $path ) {
    			$value = _wp_array_get( $input, $path );
    			if (
    				is_string( $value ) &&
    				static::is_safe_css_declaration( $property, $value )
    			) {
    				_wp_array_set( $output, $path, $value );
    			}
    		}
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-theme-json.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-theme-json.php#L3796)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-theme-json.php#L3796-L3808)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_theme_json/remove_indirect_properties/?output_format=md#related)󠁿

| Uses | Description | 
| [_wp_array_set()](https://developer.wordpress.org/reference/functions/_wp_array_set/)`wp-includes/functions.php` |

Sets an array in depth based on a path of keys.

  | 
| [_wp_array_get()](https://developer.wordpress.org/reference/functions/_wp_array_get/)`wp-includes/functions.php` |

Accesses an array in depth based on a path of keys.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_theme_json/remove_indirect_properties/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.2.0](https://developer.wordpress.org/reference/since/6.2.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_theme_json%2Fremove_indirect_properties%2F)
before being able to contribute a note or feedback.