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

Commit

Permalink
Merge pull request #249 from xwp/feature/skip-minified-scripts-if-git…
Browse files Browse the repository at this point in the history
…-submodule

Use non-minified scripts and styles if plugin installed via git (submodule)
  • Loading branch information
westonruter authored Sep 6, 2016
2 parents 17e3cd2 + 2de818a commit 2ed0cc2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions php/class-customize-posts-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,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 @@ -380,7 +381,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 2ed0cc2

Please sign in to comment.