Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/10/2021 01:29:52 AM (5 years ago)
Author:
imath
Message:

Use an XHR request to dismiss the BP Add-ons screen welcome panel

This commit also improves oursrc/js folder to be able to generate Modern JavaScript files for BP Admin screens. It starts with removing the need to add a dependency to jQuery for the BP Add-ons screen and the WP-Admin extended profile screen.

Fixes #8148

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php

    r13108 r13164  
    9898                <?php endif; ?>
    9999
    100                 <?php if ( ! bp_get_the_profile_field_is_required() ) : ?>
    101 
    102                         <a class="clear-value" href="javascript:clear( '<?php echo esc_js( bp_get_the_profile_field_input_name() ); ?>[]' );">
     100                <?php if ( ! bp_get_the_profile_field_is_required() ) :
     101
     102                        $clear = 'clear';
     103                        if ( is_admin() && ! wp_doing_ajax() ) {
     104                                $clear = 'bp.clear';
     105                        }
     106
     107                        $js_clear = sprintf( 'javascript:%1$s( \'%2$s[]\' );', $clear, esc_js( bp_get_the_profile_field_input_name() ) );
     108                ?>
     109
     110                        <a class="clear-value" href="<?php echo $js_clear; ?>">
    103111                                <?php esc_html_e( 'Clear', 'buddypress' ); ?>
    104112                        </a>
Note: See TracChangeset for help on using the changeset viewer.