Making WordPress.org

Changeset 4781


Ignore:
Timestamp:
01/25/2017 01:28:50 PM (9 years ago)
Author:
iandunn
Message:

WordCamp Base: Replace get_output_mode() with skip_stylesheet() to avoid bug

Previously (in r4590), Remote CSS's get_output_mode() was used, because it just pulls the theme mod setting directly, which is nice because it doesn't require Jetpack's Custom CSS module to be active on the site. That led to a bug where sometimes the CSS being output in the Site Cloner preview was wrong, though. If the target site has replace mode on, and the source site didn't, then the source site's theme stylesheet would be removed, because the Base theme didn't realize that it should be checking the mode on the target site, rather than the source site. Switching to skip_stylesheet() fixes that, since the Source_Site_ID_Setting::preview_skip_stylesheet hooks into the process and switches to the target site when the value is being pulled. Fixing that far outweighs the benefit of not requiring Custom CSS to be active.

Location:
sites/trunk/wordcamp.org/public_html/wp-content/themes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-base-v2/lib/structure/class-wcb-structure.php

    r4590 r4781  
    11<?php
    2 
    3 use WordCamp\RemoteCSS;
    42
    53class WCB_Structure extends WCB_Loader {
     
    4442
    4543        // Don't output CSS if Jetpack Custom CSS/RemoteCSS is set to 'replace' mode
    46         if ( 'replace' === RemoteCSS\get_output_mode() ) {
     44        require_once( JETPACK__PLUGIN_DIR . '/modules/custom-css/custom-css-4.7.php' );
     45        if ( Jetpack_Custom_CSS_Enhancements::skip_stylesheet() ) {
    4746            return;
    4847        }
    4948
     49        // todo - this filter is not used anywhere and can be removed. Custom CSS and Remote CSS have options for this instead.
    5050        $start_fresh = apply_filters( 'wcb_start_fresh', false );
    5151        $child_recs  = array();
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-base/lib/structure/class-wcb-structure.php

    r4590 r4781  
    11<?php
    2 
    3 use WordCamp\RemoteCSS;
    42
    53class WCB_Structure extends WCB_Loader {
     
    4442
    4543        // Don't output CSS if Jetpack Custom CSS/RemoteCSS is set to 'replace' mode
    46         if ( 'replace' === RemoteCSS\get_output_mode() ) {
     44        require_once( JETPACK__PLUGIN_DIR . '/modules/custom-css/custom-css-4.7.php' );
     45        if ( Jetpack_Custom_CSS_Enhancements::skip_stylesheet() ) {
    4746            return;
    4847        }
    4948
     49        // todo - this filter is not used anywhere and can be removed. Custom CSS and Remote CSS have options for this instead.
    5050        $start_fresh = apply_filters( 'wcb_start_fresh', false );
    5151        $child_recs  = array();
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/functions.php

    r4624 r4781  
    826826
    827827            // Count the number of cities
     828            // @todo use _venue_city field since it'll be more accurate, but need to populate older camps first
    828829            foreach ( $wordcamps->posts as $wordcamp ) {
    829830                $url = get_post_meta( $wordcamp->ID, 'URL', true );
Note: See TracChangeset for help on using the changeset viewer.