From ae1f2190bb214285bf55b551ff55a33650af36ed Mon Sep 17 00:00:00 2001 From: ryandhubbard Date: Wed, 17 Aug 2016 14:03:10 -0700 Subject: [PATCH] Fixed #3697 css file loads in the WordPress admin, but I can't find any page admin page where it is used. Added if statement to test --- modules/theme-tools/compat/twentyfifteen.php | 12 +++++++----- modules/theme-tools/compat/twentyfourteen.php | 12 +++++++----- modules/theme-tools/compat/twentysixteen.php | 12 +++++++----- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/modules/theme-tools/compat/twentyfifteen.php b/modules/theme-tools/compat/twentyfifteen.php index 5f93adb6c3d9f..b48a971f24bde 100644 --- a/modules/theme-tools/compat/twentyfifteen.php +++ b/modules/theme-tools/compat/twentyfifteen.php @@ -18,11 +18,13 @@ function twentyfifteen_init_jetpack() { * Set the version equal to filemtime for development builds, and the JETPACK__VERSION for production * or skip it entirely for wpcom. */ - $version = false; - if ( method_exists( 'Jetpack', 'is_development_version' ) ) { - $version = Jetpack::is_development_version() ? filemtime( plugin_dir_path( __FILE__ ) . 'twentyfifteen.css' ) : JETPACK__VERSION; + if ( ! is_admin() ) { + $version = false; + if ( method_exists( 'Jetpack', 'is_development_version' ) ) { + $version = Jetpack::is_development_version() ? filemtime( plugin_dir_path( __FILE__ ) . 'twentyfifteen.css' ) : JETPACK__VERSION; + } + wp_enqueue_style( 'twentyfifteen-jetpack', plugins_url( 'twentyfifteen.css', __FILE__ ), array(), $version ); + wp_style_add_data( 'twentyfifteen-jetpack', 'rtl', 'replace' ); } - wp_enqueue_style( 'twentyfifteen-jetpack', plugins_url( 'twentyfifteen.css', __FILE__ ), array(), $version ); - wp_style_add_data( 'twentyfifteen-jetpack', 'rtl', 'replace' ); } add_action( 'init', 'twentyfifteen_init_jetpack' ); diff --git a/modules/theme-tools/compat/twentyfourteen.php b/modules/theme-tools/compat/twentyfourteen.php index 4ee6289f48bc8..7c3859a15ff63 100644 --- a/modules/theme-tools/compat/twentyfourteen.php +++ b/modules/theme-tools/compat/twentyfourteen.php @@ -61,11 +61,13 @@ function twentyfourteen_init_jetpack() { * Add our compat CSS file for custom widget stylings and such. * Set the version equal to filemtime for development builds, and the JETPACK__VERSION for production. */ - $version = false; - if ( method_exists( 'Jetpack', 'is_development_version' ) ) { - $version = Jetpack::is_development_version() ? filemtime( plugin_dir_path( __FILE__ ) . 'twentyfourteen.css' ) : JETPACK__VERSION; + if ( ! is_admin() ) { + $version = false; + if ( method_exists( 'Jetpack', 'is_development_version' ) ) { + $version = Jetpack::is_development_version() ? filemtime( plugin_dir_path( __FILE__ ) . 'twentyfourteen.css' ) : JETPACK__VERSION; + } + wp_enqueue_style( 'twentyfourteen-jetpack', plugins_url( 'twentyfourteen.css', __FILE__ ), array(), $version ); + wp_style_add_data( 'twentyfourteen-jetpack', 'rtl', 'replace' ); } - wp_enqueue_style( 'twentyfourteen-jetpack', plugins_url( 'twentyfourteen.css', __FILE__ ), array(), $version ); - wp_style_add_data( 'twentyfourteen-jetpack', 'rtl', 'replace' ); } add_action( 'init', 'twentyfourteen_init_jetpack' ); diff --git a/modules/theme-tools/compat/twentysixteen.php b/modules/theme-tools/compat/twentysixteen.php index 2881790b00c09..4f96c7c4b830d 100644 --- a/modules/theme-tools/compat/twentysixteen.php +++ b/modules/theme-tools/compat/twentysixteen.php @@ -18,12 +18,14 @@ function twentysixteen_init_jetpack() { * Set the version equal to filemtime for development builds, and the JETPACK__VERSION for production * or skip it entirely for wpcom. */ - $version = false; - if ( method_exists( 'Jetpack', 'is_development_version' ) ) { - $version = Jetpack::is_development_version() ? filemtime( plugin_dir_path( __FILE__ ) . 'twentysixteen.css' ) : JETPACK__VERSION; + if ( ! is_admin() ) { + $version = false; + if ( method_exists( 'Jetpack', 'is_development_version' ) ) { + $version = Jetpack::is_development_version() ? filemtime( plugin_dir_path( __FILE__ ) . 'twentysixteen.css' ) : JETPACK__VERSION; + } + wp_enqueue_style( 'twentysixteen-jetpack', plugins_url( 'twentysixteen.css', __FILE__ ), array(), $version ); + wp_style_add_data( 'twentysixteen-jetpack', 'rtl', 'replace' ); } - wp_enqueue_style( 'twentysixteen-jetpack', plugins_url( 'twentysixteen.css', __FILE__ ), array(), $version ); - wp_style_add_data( 'twentysixteen-jetpack', 'rtl', 'replace' ); } add_action( 'init', 'twentysixteen_init_jetpack' );