Making WordPress.org


Ignore:
Timestamp:
01/19/2017 12:45:23 AM (8 years ago)
Author:
iandunn
Message:

WordCamp Site Cloner: Set theme mods before saving to sanitize correct field

If the CSS is saved and sanitized before the theme mods are set, then Jetpack use the previous preprocessor value, which will often be incorrect. In many cases, this leads to sanitizing the preprocssed CSS instead of the vanilla CSS, which breaks it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-site-cloner/includes/source-site-id-setting.php

    r4577 r4726  
    158158        restore_current_blog();
    159159
     160        /*
     161         * The vanilla CSS will be sanitized by Jetpack and our custom sanitization during `update_custom_css_data`.
     162         * The theme mods need to be set _first_, so that the Jetpack knows whether or not a preprocessor should
     163         * be used.
     164         */
     165        set_theme_mod( 'jetpack_custom_css', $source_site_theme_mods );
    160166        wp_update_custom_css_post( $source_site_css );
    161         set_theme_mod( 'jetpack_custom_css', $source_site_theme_mods );
    162167    }
    163168}
Note: See TracChangeset for help on using the changeset viewer.