Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/10/2021 01:29:52 AM (4 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-radiobutton.php

    r11618 r13164  
    8282            <?php bp_the_profile_field_options( array( 'user_id' => $user_id ) );
    8383
    84             if ( ! bp_get_the_profile_field_is_required() ) : ?>
    85 
    86                 <a class="clear-value" href="javascript:clear( '<?php echo esc_js( bp_get_the_profile_field_input_name() ); ?>' );">
     84            if ( ! bp_get_the_profile_field_is_required() ) :
     85
     86                $clear = 'clear';
     87                if ( is_admin() && ! wp_doing_ajax() ) {
     88                    $clear = 'bp.clear';
     89                }
     90
     91                $js_clear = sprintf( 'javascript:%1$s( \'%2$s\' );', $clear, esc_js( bp_get_the_profile_field_input_name() ) );
     92            ?>
     93
     94                <a class="clear-value" href="<?php echo $js_clear; ?>">
    8795                    <?php esc_html_e( 'Clear', 'buddypress' ); ?>
    8896                </a>
Note: See TracChangeset for help on using the changeset viewer.