Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/29/2021 08:31:02 AM (5 years ago)
Author:
imath
Message:

Member Invites: add missing /* translators: */ inline comments

This commit also:

  • adds some tiny improvements to get along with WP Coding Standards,
  • removes a forgotten PHP notice using the right $args variable instead of the undefined $all_args one in bp_members_invitations_get_registration_welcome_message()
  • removes an extra <hr class="wp-header-end"> into the Manage Invitations Admin screen that was causing admin notices to appear twice.
  • Uses the wpautop() function instead of an inexisting wpautop filter into bp_members_invitations_add_legacy_welcome_message() and bp_members_invitations_add_legacy_registration_disabled_message().

Huge Props dcavins for this awesome new feature!

See #8139

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/classes/class-bp-members-invitations-template.php

    r12919 r12930  
    163163
    164164                // Parse arguments.
    165                 $r = wp_parse_args( $args, array(
    166                         'id'                => false,
    167                         'user_id'           => false,
    168                         'inviter_id'        => false,
    169                         'invitee_email'     => false,
    170                         'item_id'           => false,
    171                         'type'              => 'invite',
    172                         'invite_sent'       => 'all',
    173                         'accepted'          => 'all',
    174                         'search_terms'      => '',
    175                         'order_by'          => 'date_modified',
    176                         'sort_order'        => 'DESC',
    177                         'page'              => 1,
    178                         'per_page'          => 25,
    179                         'fields'            => 'all',
    180                         'page_arg'          => 'ipage',
    181                 ) );
     165                $r = wp_parse_args(
     166                        $args,
     167                        array(
     168                                'id'            => false,
     169                                'user_id'       => false,
     170                                'inviter_id'    => false,
     171                                'invitee_email' => false,
     172                                'item_id'       => false,
     173                                'type'          => 'invite',
     174                                'invite_sent'   => 'all',
     175                                'accepted'      => 'all',
     176                                'search_terms'  => '',
     177                                'order_by'      => 'date_modified',
     178                                'sort_order'    => 'DESC',
     179                                'page'          => 1,
     180                                'per_page'      => 25,
     181                                'fields'        => 'all',
     182                                'page_arg'      => 'ipage',
     183                        )
     184                );
    182185
    183186                // Sort order direction.
     
    191194                // Setup variables.
    192195                $this->pag_arg      = sanitize_key( $r['page_arg'] );
    193                 $this->pag_page     = bp_sanitize_pagination_arg( $this->pag_arg, $r['page']     );
    194                 $this->pag_num      = bp_sanitize_pagination_arg( 'num',          $r['per_page'] );
     196                $this->pag_page     = bp_sanitize_pagination_arg( $this->pag_arg, $r['page'] );
     197                $this->pag_num      = bp_sanitize_pagination_arg( 'num', $r['per_page'] );
    195198                $this->user_id      = $r['user_id'];
    196199                $this->search_terms = $r['search_terms'];
     
    198201                $this->sort_order   = $r['sort_order'];
    199202                $this->query_vars   = array(
    200                         'id'                => $r['id'],
    201                         'user_id'           => $r['user_id'],
    202                         'inviter_id'        => $r['inviter_id'],
    203                         'invitee_email'     => $r['invitee_email'],
    204                         'item_id'           => $r['item_id'],
    205                         'type'              => $r['type'],
    206                         'invite_sent'       => $r['invite_sent'],
    207                         'accepted'          => $r['accepted'],
    208                         'search_terms'      => $this->search_terms,
    209                         'order_by'          => $this->order_by,
    210                         'sort_order'        => $this->sort_order,
    211                         'page'              => $this->pag_page,
    212                         'per_page'          => $this->pag_num,
     203                        'id'            => $r['id'],
     204                        'user_id'       => $r['user_id'],
     205                        'inviter_id'    => $r['inviter_id'],
     206                        'invitee_email' => $r['invitee_email'],
     207                        'item_id'       => $r['item_id'],
     208                        'type'          => $r['type'],
     209                        'invite_sent'   => $r['invite_sent'],
     210                        'accepted'      => $r['accepted'],
     211                        'search_terms'  => $this->search_terms,
     212                        'order_by'      => $this->order_by,
     213                        'sort_order'    => $this->sort_order,
     214                        'page'          => $this->pag_page,
     215                        'per_page'      => $this->pag_num,
    213216                );
    214217
     
    225228                        );
    226229
    227                         $this->pag_links = paginate_links( array(
    228                                 'base'      => add_query_arg( $this->pag_arg, '%#%' ),
    229                                 'format'    => '',
    230                                 'total'     => ceil( (int) $this->total_invitation_count / (int) $this->pag_num ),
    231                                 'current'   => $this->pag_page,
    232                                 'prev_text' => _x( '&larr;', 'Network invitation pagination previous text', 'buddypress' ),
    233                                 'next_text' => _x( '&rarr;', 'Network invitation pagination next text',     'buddypress' ),
    234                                 'mid_size'  => 1,
    235                                 'add_args'  => $add_args,
    236                         ) );
     230                        $this->pag_links = paginate_links(
     231                                array(
     232                                        'base'      => add_query_arg( $this->pag_arg, '%#%' ),
     233                                        'format'    => '',
     234                                        'total'     => ceil( (int) $this->total_invitation_count / (int) $this->pag_num ),
     235                                        'current'   => $this->pag_page,
     236                                        'prev_text' => _x( '&larr;', 'Network invitation pagination previous text', 'buddypress' ),
     237                                        'next_text' => _x( '&rarr;', 'Network invitation pagination next text', 'buddypress' ),
     238                                        'mid_size'  => 1,
     239                                        'add_args'  => $add_args,
     240                                )
     241                        );
    237242                }
    238243        }
Note: See TracChangeset for help on using the changeset viewer.