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-groups/bp-groups-admin.php

    r10569 r10613  
    7979    $redirect_to = remove_query_arg( array( 'action', 'action2', 'gid', 'deleted', 'error', 'updated', 'success_new', 'error_new', 'success_modified', 'error_modified' ), $_SERVER['REQUEST_URI'] );
    8080
    81     // Decide whether to load the dev version of the CSS and JavaScript.
    82     $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : 'min.';
    83 
    84     $doaction = bp_admin_list_table_current_bulk_action();
     81    $doaction   = bp_admin_list_table_current_bulk_action();
     82    $min        = bp_core_get_minified_asset_suffix();
    8583
    8684    /**
     
    188186
    189187    // Enqueue CSS and JavaScript.
    190     wp_enqueue_script( 'bp_groups_admin_js', $bp->plugin_url . "bp-groups/admin/js/admin.{$min}js", array( 'jquery', 'wp-ajax-response', 'jquery-ui-autocomplete' ), bp_get_version(), true );
     188    wp_enqueue_script( 'bp_groups_admin_js', $bp->plugin_url . "bp-groups/admin/js/admin{$min}.js", array( 'jquery', 'wp-ajax-response', 'jquery-ui-autocomplete' ), bp_get_version(), true );
    191189    wp_localize_script( 'bp_groups_admin_js', 'BP_Group_Admin', array(
    192190        'add_member_placeholder' => __( 'Start typing a username to add a new member.', 'buddypress' ),
    193191        'warn_on_leave'          => __( 'If you leave this page, you will lose any unsaved changes you have made to the group.', 'buddypress' ),
    194192    ) );
    195     wp_enqueue_style( 'bp_groups_admin_css', $bp->plugin_url . "bp-groups/admin/css/admin.{$min}css", array(), bp_get_version() );
     193    wp_enqueue_style( 'bp_groups_admin_css', $bp->plugin_url . "bp-groups/admin/css/admin{$min}.css", array(), bp_get_version() );
    196194
    197195    wp_style_add_data( 'bp_groups_admin_css', 'rtl', true );
Note: See TracChangeset for help on using the changeset viewer.