unset_setting_by_path example


    private static function rename_settings( &$settings$paths_to_rename ) {
        foreach ( $paths_to_rename as $original => $renamed ) {
            $original_path = explode( '.', $original );
            $renamed_path  = explode( '.', $renamed );
            $current_value = _wp_array_get( $settings$original_path, null );

            if ( null !== $current_value ) {
                _wp_array_set( $settings$renamed_path$current_value );
                self::unset_setting_by_path( $settings$original_path );
            }
        }
    }

    /** * Removes a property from within the provided settings by its path. * * @since 5.9.0 * * @param array $settings Reference to the current settings array. * @param array $path Path to the property to be removed. */
Home | Imprint | This part of the site doesn't use cookies.