$this->
set_post_value( $setting_id,
$setting_params['value'
] ); // Add to post values so that they can be validated and sanitized.
} } // Note that in addition to post data, this will include any stashed theme mods.
$post_values =
$this->
unsanitized_post_values( array
( 'exclude_changeset' => true,
'exclude_post_data' => false,
) );
$this->
add_dynamic_settings( array_keys( $post_values ) ); // Ensure settings get created even if they lack an input value.
/*
* Get list of IDs for settings that have values different from what is currently
* saved in the changeset. By skipping any values that are already the same, the
* subset of changed settings can be passed into validate_setting_values to prevent
* an underprivileged modifying a single setting for which they have the capability
* from being blocked from saving. This also prevents a user from touching of the
* previous saved settings and overriding the associated user_id if they made no change.
*/
$changed_setting_ids = array
();
foreach ( $post_values as $setting_id =>
$setting_value ) {