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

Use non-minified scripts and styles if plugin installed via git (submodule) #249

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions php/class-customize-posts-plugin.php
Original file line number Diff line number Diff line change
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