Removes a property from within the provided settings by its path.
Parameters
$settings
arrayrequired- Reference to the current settings array.
$path
arrayrequired- Path to the property to be removed.
Source
private static function unset_setting_by_path( &$settings, $path ) {
$tmp_settings = &$settings;
$last_key = array_pop( $path );
foreach ( $path as $key ) {
$tmp_settings = &$tmp_settings[ $key ];
}
unset( $tmp_settings[ $last_key ] );
}
Changelog
Version | Description |
---|---|
5.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.