foreach ( $changeset_setting_ids as $setting_id ) { $setting =
$this->
get_setting( $setting_id );
if ( $setting ) { /*
* Set the current user to match the user who saved the value into
* the changeset so that any filters that apply during the save
* process will respect the original user's capabilities. This
* will ensure, for example, that KSES won't strip unsafe HTML
* when a scheduled changeset publishes via WP Cron.
*/
if ( isset( $setting_user_ids[ $setting_id ] ) ) { wp_set_current_user( $setting_user_ids[ $setting_id ] );
} else { wp_set_current_user( $original_user_id );
} $setting->
save();
} } wp_set_current_user( $original_user_id );
// Update the stashed theme mod settings, removing the active theme's stashed settings, if activated.
if ( did_action( 'switch_theme'
) ) {