Skip to:
Content

BuddyPress.org

Changeset 12951


Ignore:
Timestamp:
05/17/2021 11:57:00 PM (3 years ago)
Author:
dcavins
Message:

Member Invites: Change screen file loading logic.

  • Move send and list invitations load actions to single screen file.

This avoids an issue where the current action isn't known
as of late_includes and could, in unusual cases, cause the
wrong screen file to be loaded.

  • Replace several vestigial 'network_invitations' mentions.

Props imath.

See #8139.

Location:
trunk/src
Files:
1 added
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/actions/invitations-bulk-manage.php

    r12938 r12951  
    2525    $action      = ! empty( $_POST['invitation_bulk_action'] ) ? $_POST['invitation_bulk_action'] : '';
    2626    $nonce       = ! empty( $_POST['invitations_bulk_nonce'] ) ? $_POST['invitations_bulk_nonce'] : '';
    27     $invitations = ! empty( $_POST['network_invitations']    ) ? $_POST['network_invitations']    : '';
     27    $invitations = ! empty( $_POST['members_invitations']    ) ? $_POST['members_invitations']    : '';
    2828
    2929    // Bail if no action or no IDs.
  • trunk/src/bp-members/bp-members-template.php

    r12935 r12951  
    32923292
    32933293        // Add the nonce.
    3294         $url = wp_nonce_url( $url, 'bp_network_invitation_resend_' . $id );
     3294        $url = wp_nonce_url( $url, 'bp_members_invitation_resend_' . $id );
    32953295
    32963296        /**
  • trunk/src/bp-members/classes/class-bp-members-component.php

    r12936 r12951  
    145145        if ( is_user_logged_in() && bp_is_user_members_invitations() ) {
    146146            // Actions.
    147             if ( bp_is_post_request() ) {
     147            if ( isset( $_POST['members_invitations'] ) ) {
    148148                require $this->path . 'bp-members/actions/invitations-bulk-manage.php';
    149149            }
    150150
    151151            // Screens.
    152             if ( bp_is_user_members_invitations_list() ) {
    153                 require $this->path . 'bp-members/screens/list-invites.php';
    154             } else {
    155                 require $this->path . 'bp-members/screens/send-invites.php';
    156             }
     152            require $this->path . 'bp-members/screens/invitations.php';
    157153        }
    158154    }
  • trunk/src/bp-templates/bp-legacy/buddypress/members/single/invitations/invitations-loop.php

    r12935 r12951  
    3737                    <td class="bulk-select-check">
    3838                        <label for="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>">
    39                             <input id="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>" type="checkbox" name="network_invitations[]" value="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>" class="invitation-check">
     39                            <input id="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>" type="checkbox" name="members_invitations[]" value="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>" class="invitation-check">
    4040                            <span class="bp-screen-reader-text">
    4141                                <?php
  • trunk/src/bp-templates/bp-legacy/buddypress/members/single/invitations/send-invites.php

    r12946 r12951  
    2424
    2525    <label for="bp_members_invitation_message"><?php esc_html_e( 'Add a personalized message to the invitation (optional)', 'buddypress' ); ?></label>
    26     <textarea id="bp_members_invitation_message" name="invite_message"></textarea>
     26    <textarea id="bp_members_invitation_message" name="content"></textarea>
    2727
    2828    <input type="hidden" name="action" value="send-invite">
  • trunk/src/bp-templates/bp-nouveau/buddypress/members/single/invitations/invitations-loop.php

    r12921 r12951  
    3535                    <td class="bulk-select-check">
    3636                        <label for="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>">
    37                             <input id="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>" type="checkbox" name="network_invitations[]" value="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>" class="invitation-check">
     37                            <input id="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>" type="checkbox" name="members_invitations[]" value="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>" class="invitation-check">
    3838                            <span class="bp-screen-reader-text">
    3939                                <?php
  • trunk/src/bp-templates/bp-nouveau/buddypress/members/single/invitations/send-invites.php

    r12946 r12951  
    2828            <?php esc_html_e( 'Add a personalized message to the invitation (optional)', 'buddypress' ); ?>
    2929        </label>
    30         <textarea id="bp_members_invitation_message" name="invite_message"></textarea>
     30        <textarea id="bp_members_invitation_message" name="content"></textarea>
    3131
    3232        <input type="hidden" name="action" value="send-invite">
Note: See TracChangeset for help on using the changeset viewer.