Skip to:
Content

BuddyPress.org

Ticket #6920: last-minute.patch

File last-minute.patch, 12.8 KB (added by DJPaul, 5 years ago)
  • src/bp-activity/bp-activity-admin.php

    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 
    201201function bp_activity_admin_load() {
    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        /**
    212209         * Fires at top of Activity admin page.
    function bp_activity_admin_load() { 
    308305        }
    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 );
    318315        if ( $min ) {
  • src/bp-activity/bp-activity-cssjs.php

    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() { 
    3131        }
    3232
    3333
    34         $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
     34        $min = bp_core_get_minified_asset_suffix();
    3535
    3636        wp_enqueue_script( 'bp-mentions', buddypress()->plugin_url . "bp-activity/js/mentions{$min}.js", array( 'jquery', 'jquery-atwho' ), bp_get_version(), true );
    3737        wp_enqueue_style( 'bp-mentions-css', buddypress()->plugin_url . "bp-activity/css/mentions{$min}.css", array(), bp_get_version() );
  • src/bp-core/bp-core-cssjs.php

    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; 
    1616 * @since 2.1.0
    1717 */
    1818function bp_core_register_common_scripts() {
    19         $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
     19        $min = bp_core_get_minified_asset_suffix();
    2020        $url = buddypress()->plugin_url . 'bp-core/js/';
    2121
    2222        /**
    add_action( 'bp_admin_enqueue_scripts', 'bp_core_register_common_scripts', 1 ); 
    6363 * @since 2.1.0
    6464 */
    6565function bp_core_register_common_styles() {
    66         $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
     66        $min = bp_core_get_minified_asset_suffix();
    6767        $url = buddypress()->plugin_url . 'bp-core/css/';
    6868
    6969        /**
  • src/bp-core/bp-core-customizer-email.php

    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 ) { 
    7878                 * the Customizer loads very, very early.
    7979                 */
    8080                $bp  = buddypress();
    81                 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
     81                $min = bp_core_get_minified_asset_suffix();
    8282
    8383                wp_enqueue_script(
    8484                        'bp-customizer-receiver-emails',
  • src/bp-core/bp-core-functions.php

    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 = '' ) { 
    23132313        return trim( $title );
    23142314}
    23152315
     2316/**
     2317 * Get the correct filename suffix for minified assets.
     2318 *
     2319 * @since 2.5.0
     2320 *
     2321 * @return string
     2322 */
     2323function 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
    23162334/** Nav Menu ******************************************************************/
    23172335
    23182336/**
  • src/bp-core/classes/class-bp-admin.php

    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 { 
    952952         * @since 2.5.0
    953953         */
    954954        public function admin_register_styles() {
    955                 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
     955                $min = bp_core_get_minified_asset_suffix();
    956956                $url = $this->css_url;
    957957
    958958                /**
    class BP_Admin { 
    10041004         * @since 2.5.0
    10051005         */
    10061006        public function admin_register_scripts() {
    1007                 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
     1007                $min = bp_core_get_minified_asset_suffix();
    10081008                $url = $this->js_url;
    10091009
    10101010                /**
  • src/bp-core/deprecated/2.1.php

    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() { 
    324324                return;
    325325        }
    326326
    327         $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
     327        $min = bp_core_get_minified_asset_suffix();
    328328
    329329        if ( file_exists( get_stylesheet_directory() . '/_inc/css/adminbar.css' ) ) { // Backwards compatibility
    330330                $stylesheet = get_stylesheet_directory_uri() . '/_inc/css/adminbar.css';
  • src/bp-friends/classes/class-bp-core-friends-widget.php

    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 { 
    4848                        return;
    4949                }
    5050
    51                 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
     51                $min = bp_core_get_minified_asset_suffix();
    5252                wp_enqueue_script( 'bp_core_widget_friends-js', buddypress()->plugin_url . "bp-friends/js/widget-friends{$min}.js", array( 'jquery' ), bp_get_version() );
    5353
    5454                $user_id = bp_displayed_user_id();
  • src/bp-groups/bp-groups-admin.php

    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() { 
    7878        // Build redirection URL.
    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        /**
    8785         * Fires at top of groups admin page.
    function bp_groups_admin_load() { 
    187185        $bp = buddypress();
    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 );
    198196        if ( $min ) {
  • src/bp-groups/classes/class-bp-groups-widget.php

    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 { 
    3030                parent::__construct( false, _x( '(BuddyPress) Groups', 'widget name', 'buddypress' ), $widget_ops );
    3131
    3232                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();
    3434                        wp_enqueue_script( 'groups_widget_groups_list-js', buddypress()->plugin_url . "bp-groups/js/widget-groups{$min}.js", array( 'jquery' ), bp_get_version() );
    3535                }
    3636        }
  • src/bp-members/classes/class-bp-members-admin.php

    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 { 
    556556                        return;
    557557                }
    558558
    559                 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
     559                $min = bp_core_get_minified_asset_suffix();
    560560                $css = $this->css_url . "admin{$min}.css";
    561561
    562562                /**
  • src/bp-messages/bp-messages-cssjs.php

    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() { 
    1919        if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) ) {
    2020                add_action( 'wp_head', 'messages_autocomplete_init_jsblock' );
    2121
    22                 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
     22                $min = bp_core_get_minified_asset_suffix();
    2323                $url = buddypress()->plugin_url . 'bp-messages/js/';
    2424
    2525                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' ); 
    3737 */
    3838function messages_add_autocomplete_css() {
    3939        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();
    4141                $url = buddypress()->plugin_url . 'bp-messages/css/';
    4242
    4343                wp_register_style( 'bp-messages-autocomplete', "{$url}autocomplete/jquery.autocompletfb{$min}.css", array(), bp_get_version() );
  • src/bp-templates/bp-legacy/buddypress-functions.php

    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 { 
    214214         * @uses wp_enqueue_style() To enqueue the styles
    215215         */
    216216        public function enqueue_styles() {
    217                 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
     217                $min = bp_core_get_minified_asset_suffix();
    218218
    219219                // Locate the BP stylesheet.
    220220                $ltr = $this->locate_asset_in_stack( "buddypress{$min}.css",     'css' );
    class BP_Legacy extends BP_Theme_Compat { 
    275275         * @since 1.7.0
    276276         */
    277277        public function enqueue_scripts() {
    278                 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
     278                $min = bp_core_get_minified_asset_suffix();
    279279
    280280                // Locate the BP JS file.
    281281                $asset = $this->locate_asset_in_stack( "buddypress{$min}.js", 'js' );
  • src/bp-xprofile/bp-xprofile-cssjs.php

    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; 
    1717 */
    1818function xprofile_add_admin_css() {
    1919        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();
    2121
    2222                wp_enqueue_style( 'xprofile-admin-css', buddypress()->plugin_url . "bp-xprofile/admin/css/admin{$min}.css", array(), bp_get_version() );
    2323
    function xprofile_add_admin_js() { 
    4343                wp_enqueue_script( 'jquery-ui-droppable' );
    4444                wp_enqueue_script( 'jquery-ui-sortable'  );
    4545
    46                 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
     46                $min = bp_core_get_minified_asset_suffix();
    4747                wp_enqueue_script( 'xprofile-admin-js', buddypress()->plugin_url . "bp-xprofile/admin/js/admin{$min}.js", array( 'jquery', 'jquery-ui-sortable' ), bp_get_version() );
    4848
    4949                // Localize strings.