On this page
WP_Theme_JSON_Schema::unset_setting_by_path( array $settings, array $path ): void
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.
Removes a property from within the provided settings by its path.
Parameters
$settingsarray Required-
Reference to the current settings array.
$patharray Required-
Path to the property to be removed.
Return
void
Source
File: wp-includes/class-wp-theme-json-schema.php. View all references
private static function unset_setting_by_path( &$settings, $path ) {
$tmp_settings = &$settings; // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
$last_key = array_pop( $path );
foreach ( $path as $key ) {
$tmp_settings = &$tmp_settings[ $key ];
}
unset( $tmp_settings[ $last_key ] );
}
Related
Used By
| Used By | Description |
|---|---|
| WP_Theme_JSON_Schema::rename_settings() wp-includes/class-wp-theme-json-schema.php | Processes a settings array, renaming or moving properties. |
Changelog
| Version | Description |
|---|---|
| 5.9.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_theme_json_schema/unset_setting_by_path