Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/09/2014 04:22:03 PM (10 years ago)
Author:
djpaul
Message:

Core: make sure we load minified JS and CSS when SCRIPT_DEBUG is set.

Fixes #5615

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress-functions.php

    r8770 r8772  
    203203
    204204        // Locate the BP stylesheet
    205         $asset = $this->locate_asset_in_stack( 'buddypress.css', 'css' );
     205        $asset = $this->locate_asset_in_stack( "buddypress{$min}.css", 'css' );
    206206
    207207        // Enqueue BuddyPress-specific styling, if found
     
    222222     */
    223223    public function enqueue_scripts() {
    224 
    225         $file = 'buddypress.js';
     224        $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
    226225
    227226        // Locate the BP JS file
    228         $asset = $this->locate_asset_in_stack( $file, 'js' );
     227        $asset = $this->locate_asset_in_stack( "buddypress{$min}.js", 'js' );
    229228
    230229        // Enqueue the global JS, if found - AJAX will not work
     
    260259        // Maybe enqueue password verify JS (register page or user settings page)
    261260        if ( bp_is_register_page() || ( function_exists( 'bp_is_user_settings_general' ) && bp_is_user_settings_general() ) ) {
    262             $min      = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
    263             $filename = "password-verify{$min}.js";
    264261
    265262            // Locate the Register Page JS file
    266             $asset = $this->locate_asset_in_stack( $filename, 'js' );
    267 
    268             // Enqueue script
     263            $asset = $this->locate_asset_in_stack( "password-verify{$min}.js", 'js' );
     264
    269265            $dependencies = array_merge( bp_core_get_js_dependencies(), array(
    270266                'password-strength-meter',
    271267            ) );
     268
     269            // Enqueue script
    272270            wp_enqueue_script( $asset['handle'] . '-password-verify', $asset['location'], $dependencies, $this->version);
    273271        }
Note: See TracChangeset for help on using the changeset viewer.