Skip to:
Content

BuddyPress.org

Changeset 13017


Ignore:
Timestamp:
07/15/2021 07:08:36 PM (4 years ago)
Author:
imath
Message:

Make sure regular users can edit field visibility in wp-admin/extended

As we're very close to 9.0.0-RC1, we're also updating credits to include leahkoerper to the list.

Props leahkoerper

Fixes #8529

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-admin.php

    r13015r13017 
    762762                        printf(
    763763                            /* translators: 1: heart dashicons. 2: BP Credits screen url. 3: number of BuddyPress contributors to this version. */
    764                             _n( 'Built with %1$s by <a href="%2$s">%3$d volunteer</a>.', 'Built with %1$s by <a href="%2$s">%3$d volunteers</a>.', 18, 'buddypress' ),
     764                            _n( 'Built with %1$s by <a href="%2$s">%3$d volunteer</a>.', 'Built with %1$s by <a href="%2$s">%3$d volunteers</a>.', 19, 'buddypress' ),
    765765                            '<span class="dashicons dashicons-heart"></span>',
    766766                            esc_url( bp_get_admin_url( 'admin.php?page=bp-credits' ) ),
    767                             number_format_i18n( 18 )
     767                            number_format_i18n( 19 )
    768768                        );
    769769                        ?>
     
    949949                <a href="https://profiles.wordpress.org/dcavins/">David Cavins (dcavins)</a>,
    950950                <a href="https://profiles.wordpress.org/johnjamesjacoby/">John James Jacoby (johnjamesjacoby)</a>,
     951                <a href="https://profiles.wordpress.org/leahkoerper/">leahkoerper</a>,
    951952                <a href="https://profiles.wordpress.org/imath/">Mathieu Viet (imath)</a>,
    952953                <a href="https://profiles.wordpress.org/modemlooper/">modemlooper</a>,
  • trunk/src/bp-members/admin/js/admin.js

    r11620r13017 
    33( function( $ ) {
    44    // Profile Visibility Settings
    5 
    65    $( '.visibility-toggle-link' ).on( 'click', function( event ) {
    76        event.preventDefault();
    87
    98        $( this ).attr( 'aria-expanded', 'true' ).parent().hide()
    10             .siblings( '.field-visibility-settings' ).show();
     9                 .siblings( '.field-visibility-settings' ).show();
    1110    } );
    1211
     
    1413        event.preventDefault();
    1514
    16          $( '.visibility-toggle-link' ).attr( 'aria-expanded', 'false' );
     15        $( '.visibility-toggle-link' ).attr( 'aria-expanded', 'false' );
    1716
    18         var settings_div = $(this).parent(),
    19         vis_setting_text = settings_div.find( 'input:checked' ).parent().text();
     17        var settings_div = $( this ).parent(),
     18            vis_setting_text = settings_div.find( 'input:checked' ).parent().text();
    2019
    2120        settings_div.hide()
    22             .siblings( '.field-visibility-settings-toggle' )
    23                 .children( '.current-visibility-level' ).text( vis_setting_text ).end()
    24             .show();
     21                    .siblings( '.field-visibility-settings-toggle' )
     22                    .find( '.current-visibility-level' ).text( vis_setting_text ).end()
     23                    .show();
    2524    } );
    2625
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-user-admin.php

    r12869r13017 
    272272
    273273        $r = bp_parse_args( $args['args'], array(
    274             'profile_group_id' => 0,
    275             'user_id'          => $user->ID,
    276             'hide_field_types' => array( 'wp-textbox', 'wp-biography' ),
     274            'profile_group_id'       => 0,
     275            'user_id'                => $user->ID,
     276            'hide_field_types'       => array( 'wp-textbox', 'wp-biography' ),
     277            'fetch_visibility_level' => bp_current_user_can( 'bp_moderate' ) || (int) $user->ID === (int) get_current_user_id(),
    277278        ), 'bp_xprofile_user_admin_profile_loop_args' );
    278279
Note: See TracChangeset for help on using the changeset viewer.