Advertisement
ried

class-wp-customize-manager.php on line 2307

Feb 20th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. /*
  2. * Get list of IDs for settings that have values different from what is currently
  3. * saved in the changeset. By skipping any values that are already the same, the
  4. * subset of changed settings can be passed into validate_setting_values to prevent
  5. * an underprivileged modifying a single setting for which they have the capability
  6. * from being blocked from saving. This also prevents a user from touching of the
  7. * previous saved settings and overriding the associated user_id if they made no change.
  8. */
  9. $changed_setting_ids = array();
  10. foreach ( $post_values as $setting_id => $setting_value ) {
  11. $setting = $this->get_setting( $setting_id );
  12.  
  13. if ( $setting && 'theme_mod' === $setting->type ) {
  14. $prefixed_setting_id = $this->get_stylesheet() . '::' . $setting->id;
  15. } else {
  16. $prefixed_setting_id = $setting_id;
  17. }
  18.  
  19. $is_value_changed = (
  20. ! isset( $existing_changeset_data[ $prefixed_setting_id ] )
  21. ||
  22. ! array_key_exists( 'value', $existing_changeset_data[ $prefixed_setting_id ] )
  23. ||
  24. $existing_changeset_data[ $prefixed_setting_id ]['value'] !== $setting_value
  25. );
  26. if ( $is_value_changed ) {
  27. $changed_setting_ids[] = $setting_id;
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement