diff --git a/src/bp-activity/bp-activity-admin.php b/src/bp-activity/bp-activity-admin.php
index 418cdc0..d917779 100644
a
|
b
|
add_filter( 'default_hidden_meta_boxes', 'bp_activity_admin_edit_hidden_metaboxe |
201 | 201 | function bp_activity_admin_load() { |
202 | 202 | global $bp_activity_list_table; |
203 | 203 | |
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(); |
209 | 205 | $doaction = bp_admin_list_table_current_bulk_action(); |
| 206 | $min = bp_core_get_minified_asset_suffix(); |
210 | 207 | |
211 | 208 | /** |
212 | 209 | * Fires at top of Activity admin page. |
… |
… |
function bp_activity_admin_load() { |
308 | 305 | } |
309 | 306 | |
310 | 307 | // 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 ); |
312 | 309 | wp_localize_script( 'bp_activity_admin_js', 'bp_activity_admin_vars', array( |
313 | 310 | 'page' => get_current_screen()->id |
314 | 311 | ) ); |
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() ); |
316 | 313 | |
317 | 314 | wp_style_add_data( 'bp_activity_admin_css', 'rtl', true ); |
318 | 315 | if ( $min ) { |
diff --git a/src/bp-activity/bp-activity-cssjs.php b/src/bp-activity/bp-activity-cssjs.php
index 83258aa..ec14cd4 100644
a
|
b
|
function bp_activity_mentions_script() { |
31 | 31 | } |
32 | 32 | |
33 | 33 | |
34 | | $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
| 34 | $min = bp_core_get_minified_asset_suffix(); |
35 | 35 | |
36 | 36 | wp_enqueue_script( 'bp-mentions', buddypress()->plugin_url . "bp-activity/js/mentions{$min}.js", array( 'jquery', 'jquery-atwho' ), bp_get_version(), true ); |
37 | 37 | wp_enqueue_style( 'bp-mentions-css', buddypress()->plugin_url . "bp-activity/css/mentions{$min}.css", array(), bp_get_version() ); |
diff --git a/src/bp-core/bp-core-cssjs.php b/src/bp-core/bp-core-cssjs.php
index 714995a..b7fc5aa 100644
a
|
b
|
defined( 'ABSPATH' ) || exit; |
16 | 16 | * @since 2.1.0 |
17 | 17 | */ |
18 | 18 | function bp_core_register_common_scripts() { |
19 | | $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
| 19 | $min = bp_core_get_minified_asset_suffix(); |
20 | 20 | $url = buddypress()->plugin_url . 'bp-core/js/'; |
21 | 21 | |
22 | 22 | /** |
… |
… |
add_action( 'bp_admin_enqueue_scripts', 'bp_core_register_common_scripts', 1 ); |
63 | 63 | * @since 2.1.0 |
64 | 64 | */ |
65 | 65 | function bp_core_register_common_styles() { |
66 | | $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
| 66 | $min = bp_core_get_minified_asset_suffix(); |
67 | 67 | $url = buddypress()->plugin_url . 'bp-core/css/'; |
68 | 68 | |
69 | 69 | /** |
diff --git a/src/bp-core/bp-core-customizer-email.php b/src/bp-core/bp-core-customizer-email.php
index 06eb33c..851bfab 100644
a
|
b
|
function bp_email_init_customizer( WP_Customize_Manager $wp_customize ) { |
78 | 78 | * the Customizer loads very, very early. |
79 | 79 | */ |
80 | 80 | $bp = buddypress(); |
81 | | $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
| 81 | $min = bp_core_get_minified_asset_suffix(); |
82 | 82 | |
83 | 83 | wp_enqueue_script( |
84 | 84 | 'bp-customizer-receiver-emails', |
diff --git a/src/bp-core/bp-core-functions.php b/src/bp-core/bp-core-functions.php
index dc93da4..41be5f4 100644
a
|
b
|
function _bp_strip_spans_from_title( $title_part = '' ) { |
2313 | 2313 | return trim( $title ); |
2314 | 2314 | } |
2315 | 2315 | |
| 2316 | /** |
| 2317 | * Get the correct filename suffix for minified assets. |
| 2318 | * |
| 2319 | * @since 2.5.0 |
| 2320 | * |
| 2321 | * @return string |
| 2322 | */ |
| 2323 | function bp_core_get_minified_asset_suffix() { |
| 2324 | $ext = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
| 2325 | |
| 2326 | // Ensure the assets can be located when running from /src/. |
| 2327 | if ( defined( 'BP_SOURCE_SUBDIRECTORY' ) && BP_SOURCE_SUBDIRECTORY === 'src' ) { |
| 2328 | $ext = str_replace( '.min', '', $ext ); |
| 2329 | } |
| 2330 | |
| 2331 | return $ext; |
| 2332 | } |
| 2333 | |
2316 | 2334 | /** Nav Menu ******************************************************************/ |
2317 | 2335 | |
2318 | 2336 | /** |
diff --git a/src/bp-core/classes/class-bp-admin.php b/src/bp-core/classes/class-bp-admin.php
index dcd5bea..7dd39f9 100644
a
|
b
|
class BP_Admin { |
952 | 952 | * @since 2.5.0 |
953 | 953 | */ |
954 | 954 | public function admin_register_styles() { |
955 | | $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
| 955 | $min = bp_core_get_minified_asset_suffix(); |
956 | 956 | $url = $this->css_url; |
957 | 957 | |
958 | 958 | /** |
… |
… |
class BP_Admin { |
1004 | 1004 | * @since 2.5.0 |
1005 | 1005 | */ |
1006 | 1006 | public function admin_register_scripts() { |
1007 | | $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
| 1007 | $min = bp_core_get_minified_asset_suffix(); |
1008 | 1008 | $url = $this->js_url; |
1009 | 1009 | |
1010 | 1010 | /** |
diff --git a/src/bp-core/deprecated/2.1.php b/src/bp-core/deprecated/2.1.php
index 5dcb198..221f50a 100644
a
|
b
|
function bp_core_load_buddybar_css() { |
324 | 324 | return; |
325 | 325 | } |
326 | 326 | |
327 | | $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
| 327 | $min = bp_core_get_minified_asset_suffix(); |
328 | 328 | |
329 | 329 | if ( file_exists( get_stylesheet_directory() . '/_inc/css/adminbar.css' ) ) { // Backwards compatibility |
330 | 330 | $stylesheet = get_stylesheet_directory_uri() . '/_inc/css/adminbar.css'; |
diff --git a/src/bp-friends/classes/class-bp-core-friends-widget.php b/src/bp-friends/classes/class-bp-core-friends-widget.php
index fc6b607..a1ea9d4 100644
a
|
b
|
class BP_Core_Friends_Widget extends WP_Widget { |
48 | 48 | return; |
49 | 49 | } |
50 | 50 | |
51 | | $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
| 51 | $min = bp_core_get_minified_asset_suffix(); |
52 | 52 | wp_enqueue_script( 'bp_core_widget_friends-js', buddypress()->plugin_url . "bp-friends/js/widget-friends{$min}.js", array( 'jquery' ), bp_get_version() ); |
53 | 53 | |
54 | 54 | $user_id = bp_displayed_user_id(); |
diff --git a/src/bp-groups/bp-groups-admin.php b/src/bp-groups/bp-groups-admin.php
index fb44a16..04a3dfd 100644
a
|
b
|
function bp_groups_admin_load() { |
78 | 78 | // Build redirection URL. |
79 | 79 | $redirect_to = remove_query_arg( array( 'action', 'action2', 'gid', 'deleted', 'error', 'updated', 'success_new', 'error_new', 'success_modified', 'error_modified' ), $_SERVER['REQUEST_URI'] ); |
80 | 80 | |
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(); |
85 | 83 | |
86 | 84 | /** |
87 | 85 | * Fires at top of groups admin page. |
… |
… |
function bp_groups_admin_load() { |
187 | 185 | $bp = buddypress(); |
188 | 186 | |
189 | 187 | // 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 ); |
191 | 189 | wp_localize_script( 'bp_groups_admin_js', 'BP_Group_Admin', array( |
192 | 190 | 'add_member_placeholder' => __( 'Start typing a username to add a new member.', 'buddypress' ), |
193 | 191 | 'warn_on_leave' => __( 'If you leave this page, you will lose any unsaved changes you have made to the group.', 'buddypress' ), |
194 | 192 | ) ); |
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() ); |
196 | 194 | |
197 | 195 | wp_style_add_data( 'bp_groups_admin_css', 'rtl', true ); |
198 | 196 | if ( $min ) { |
diff --git a/src/bp-groups/classes/class-bp-groups-widget.php b/src/bp-groups/classes/class-bp-groups-widget.php
index f529cbe..e7ff6e0 100644
a
|
b
|
class BP_Groups_Widget extends WP_Widget { |
30 | 30 | parent::__construct( false, _x( '(BuddyPress) Groups', 'widget name', 'buddypress' ), $widget_ops ); |
31 | 31 | |
32 | 32 | if ( is_active_widget( false, false, $this->id_base ) && ! is_admin() && ! is_network_admin() ) { |
33 | | $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
| 33 | $min = bp_core_get_minified_asset_suffix(); |
34 | 34 | wp_enqueue_script( 'groups_widget_groups_list-js', buddypress()->plugin_url . "bp-groups/js/widget-groups{$min}.js", array( 'jquery' ), bp_get_version() ); |
35 | 35 | } |
36 | 36 | } |
diff --git a/src/bp-members/classes/class-bp-members-admin.php b/src/bp-members/classes/class-bp-members-admin.php
index 019b945..8e43006 100644
a
|
b
|
class BP_Members_Admin { |
556 | 556 | return; |
557 | 557 | } |
558 | 558 | |
559 | | $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
| 559 | $min = bp_core_get_minified_asset_suffix(); |
560 | 560 | $css = $this->css_url . "admin{$min}.css"; |
561 | 561 | |
562 | 562 | /** |
diff --git a/src/bp-messages/bp-messages-cssjs.php b/src/bp-messages/bp-messages-cssjs.php
index efc074c..33cdf16 100644
a
|
b
|
function messages_add_autocomplete_js() { |
19 | 19 | if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) ) { |
20 | 20 | add_action( 'wp_head', 'messages_autocomplete_init_jsblock' ); |
21 | 21 | |
22 | | $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
| 22 | $min = bp_core_get_minified_asset_suffix(); |
23 | 23 | $url = buddypress()->plugin_url . 'bp-messages/js/'; |
24 | 24 | |
25 | 25 | wp_enqueue_script( 'bp-jquery-autocomplete', "{$url}autocomplete/jquery.autocomplete{$min}.js", array( 'jquery' ), bp_get_version() ); |
… |
… |
add_action( 'bp_enqueue_scripts', 'messages_add_autocomplete_js' ); |
37 | 37 | */ |
38 | 38 | function messages_add_autocomplete_css() { |
39 | 39 | if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) ) { |
40 | | $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
| 40 | $min = bp_core_get_minified_asset_suffix(); |
41 | 41 | $url = buddypress()->plugin_url . 'bp-messages/css/'; |
42 | 42 | |
43 | 43 | wp_register_style( 'bp-messages-autocomplete', "{$url}autocomplete/jquery.autocompletfb{$min}.css", array(), bp_get_version() ); |
diff --git a/src/bp-templates/bp-legacy/buddypress-functions.php b/src/bp-templates/bp-legacy/buddypress-functions.php
index 14ac15e..e720922 100644
a
|
b
|
class BP_Legacy extends BP_Theme_Compat { |
214 | 214 | * @uses wp_enqueue_style() To enqueue the styles |
215 | 215 | */ |
216 | 216 | public function enqueue_styles() { |
217 | | $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
| 217 | $min = bp_core_get_minified_asset_suffix(); |
218 | 218 | |
219 | 219 | // Locate the BP stylesheet. |
220 | 220 | $ltr = $this->locate_asset_in_stack( "buddypress{$min}.css", 'css' ); |
… |
… |
class BP_Legacy extends BP_Theme_Compat { |
275 | 275 | * @since 1.7.0 |
276 | 276 | */ |
277 | 277 | public function enqueue_scripts() { |
278 | | $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
| 278 | $min = bp_core_get_minified_asset_suffix(); |
279 | 279 | |
280 | 280 | // Locate the BP JS file. |
281 | 281 | $asset = $this->locate_asset_in_stack( "buddypress{$min}.js", 'js' ); |
diff --git a/src/bp-xprofile/bp-xprofile-cssjs.php b/src/bp-xprofile/bp-xprofile-cssjs.php
index cc89582..221cfaa 100644
a
|
b
|
defined( 'ABSPATH' ) || exit; |
17 | 17 | */ |
18 | 18 | function xprofile_add_admin_css() { |
19 | 19 | if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) { |
20 | | $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
| 20 | $min = bp_core_get_minified_asset_suffix(); |
21 | 21 | |
22 | 22 | wp_enqueue_style( 'xprofile-admin-css', buddypress()->plugin_url . "bp-xprofile/admin/css/admin{$min}.css", array(), bp_get_version() ); |
23 | 23 | |
… |
… |
function xprofile_add_admin_js() { |
43 | 43 | wp_enqueue_script( 'jquery-ui-droppable' ); |
44 | 44 | wp_enqueue_script( 'jquery-ui-sortable' ); |
45 | 45 | |
46 | | $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
| 46 | $min = bp_core_get_minified_asset_suffix(); |
47 | 47 | wp_enqueue_script( 'xprofile-admin-js', buddypress()->plugin_url . "bp-xprofile/admin/js/admin{$min}.js", array( 'jquery', 'jquery-ui-sortable' ), bp_get_version() ); |
48 | 48 | |
49 | 49 | // Localize strings. |