Making WordPress.org


Ignore:
Timestamp:
08/13/2020 06:39:11 AM (5 years ago)
Author:
dd32
Message:

WordPress.org Base Theme: Only load the wporg-style CSS through the CDN when the theme is in use on WordPress.org.

Makes local development easier.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg/functions.php

    r9690 r10163  
    150150    }
    151151
    152     // Use CDN url.
    153     if ( in_array( $handle, $cdn_handles, true ) ) {
    154         $src = str_replace( get_home_url(), 'https://s.w.org', $src );
     152    // Use CDN url when running on WordPress.org production.
     153    if ( defined( 'IS_WPORG' ) && IS_WPORG ) {
     154        if ( in_array( $handle, $cdn_handles, true ) ) {
     155            $src = str_replace( get_home_url(), 'https://s.w.org', $src );
     156        }
    155157    }
    156158
Note: See TracChangeset for help on using the changeset viewer.