Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Use non-minified scripts and styles if plugin installed via git (subm…
Browse files Browse the repository at this point in the history
…odule)
  • Loading branch information
westonruter committed Sep 6, 2016
1 parent 35ce99b commit 2de818a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions php/class-customize-posts-plugin.php
Expand Up @@ -177,7 +177,8 @@ function show_core_version_dependency_failure() {
* @param WP_Scripts $wp_scripts Scripts.
*/
public function register_scripts( WP_Scripts $wp_scripts ) {
$suffix = ( SCRIPT_DEBUG ? '' : '.min' ) . '.js';
$is_git_repo = file_exists( dirname( dirname( __FILE__ ) ) . '/.git' );
$suffix = ( SCRIPT_DEBUG || $is_git_repo ? '' : '.min' ) . '.js';

$handle = 'select2';
if ( ! $wp_scripts->query( $handle, 'registered' ) ) {
Expand Down Expand Up @@ -320,7 +321,8 @@ public function register_scripts( WP_Scripts $wp_scripts ) {
* @param WP_Styles $wp_styles Styles.
*/
public function register_styles( WP_Styles $wp_styles ) {
$suffix = ( SCRIPT_DEBUG ? '' : '.min' ) . '.css';
$is_git_repo = file_exists( dirname( dirname( __FILE__ ) ) . '/.git' );
$suffix = ( SCRIPT_DEBUG || $is_git_repo ? '' : '.min' ) . '.css';

$handle = 'select2';
if ( ! $wp_styles->query( $handle, 'registered' ) ) {
Expand Down

0 comments on commit 2de818a

Please sign in to comment.