Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/18/2016 11:10:33 AM (9 years ago)
Author:
djpaul
Message:

Fix script/style enqueue path when using BP dev. repo. with release build of WP, and SCRIPT_DEBUG=false.

If you have a WordPress release build (that is, not the dev SVN with its src folder) with a BuddyPress dev build (with its src folder), and set SCRIPT_DEBUG=false, BuddyPress will try to load the minified versions of its CSS and JS assets. As these minified assets only exist in our release builds, this causes 404 errors in this particular set of circumstances.

Fixes #6920

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-admin.php

    r10516 r10613  
    202202    global $bp_activity_list_table;
    203203
    204     $bp = buddypress();
    205 
    206     // Decide whether to load the dev version of the CSS and JavaScript.
    207     $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : 'min.';
    208 
     204    $bp       = buddypress();
    209205    $doaction = bp_admin_list_table_current_bulk_action();
     206    $min      = bp_core_get_minified_asset_suffix();
    210207
    211208    /**
     
    309306
    310307    // Enqueue CSS and JavaScript.
    311     wp_enqueue_script( 'bp_activity_admin_js', $bp->plugin_url . "bp-activity/admin/js/admin.{$min}js",   array( 'jquery', 'wp-ajax-response' ), bp_get_version(), true );
     308    wp_enqueue_script( 'bp_activity_admin_js', $bp->plugin_url . "bp-activity/admin/js/admin{$min}.js",   array( 'jquery', 'wp-ajax-response' ), bp_get_version(), true );
    312309    wp_localize_script( 'bp_activity_admin_js', 'bp_activity_admin_vars', array(
    313310        'page' => get_current_screen()->id
    314311    ) );
    315     wp_enqueue_style( 'bp_activity_admin_css', $bp->plugin_url . "bp-activity/admin/css/admin.{$min}css", array(),                               bp_get_version()       );
     312    wp_enqueue_style( 'bp_activity_admin_css', $bp->plugin_url . "bp-activity/admin/css/admin{$min}.css", array(),                               bp_get_version()       );
    316313
    317314    wp_style_add_data( 'bp_activity_admin_css', 'rtl', true );
Note: See TracChangeset for help on using the changeset viewer.