Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/10/2021 03:07:55 PM (4 years ago)
Author:
dcavins
Message:

Member Invites: Add "not allowed" message to invite send form.

BuddyPress Core will not allow you to access the send form
unless you have the bp_members_send_invitation
capability, so this message will generally not be accessed.
However, if a plugin wishes to allow access to the "send"
screen but prevent sending in order to display an error
message, this message will be used.

Props imath.

See #8139.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/buddypress/members/single/invitations/send-invites.php

    r12921 r12946  
    1414</h2>
    1515
    16 <p class="bp-feedback info">
    17     <span class="bp-icon" aria-hidden="true"></span>
    18     <span class="bp-help-text">
    19         <?php esc_html_e( 'Fill out the form below to invite a new user to join this site. Upon submission of the form, an email will be sent to the invitee containing a link to accept your invitation. You may also add a custom message to the email.', 'buddypress' ); ?>
    20     </span>
    21 </p>
     16<?php if ( bp_user_can( bp_displayed_user_id(), 'bp_members_send_invitation' ) ) : ?>
    2217
    23 <form class="standard-form network-invitation-form" id="network-invitation-form" method="post">
    24     <label for="bp_members_invitation_invitee_email">
    25         <?php esc_html_e( 'Email', 'buddypress' ); ?>
    26         <span class="bp-required-field-label"><?php esc_html_e( '(required)', 'buddypress' ); ?></span>
    27     </label>
    28     <input id="bp_members_invitation_invitee_email" type="email" name="invitee_email" required="required">
     18    <?php bp_nouveau_user_feedback( 'member-invitations-help' ); ?>
    2919
    30     <label for="bp_members_invitation_message">
    31         <?php esc_html_e( 'Add a personalized message to the invitation (optional)', 'buddypress' ); ?>
    32     </label>
    33     <textarea id="bp_members_invitation_message" name="invite_message"></textarea>
     20    <form class="standard-form network-invitation-form" id="network-invitation-form" method="post">
     21        <label for="bp_members_invitation_invitee_email">
     22            <?php esc_html_e( 'Email', 'buddypress' ); ?>
     23            <span class="bp-required-field-label"><?php esc_html_e( '(required)', 'buddypress' ); ?></span>
     24        </label>
     25        <input id="bp_members_invitation_invitee_email" type="email" name="invitee_email" required="required">
    3426
    35     <input type="hidden" name="action" value="send-invite">
     27        <label for="bp_members_invitation_message">
     28            <?php esc_html_e( 'Add a personalized message to the invitation (optional)', 'buddypress' ); ?>
     29        </label>
     30        <textarea id="bp_members_invitation_message" name="invite_message"></textarea>
    3631
    37     <?php bp_nouveau_submit_button( 'member-send-invite' ); ?>
    38 </form>
     32        <input type="hidden" name="action" value="send-invite">
     33
     34        <?php bp_nouveau_submit_button( 'member-send-invite' ); ?>
     35    </form>
     36
     37<?php else : ?>
     38
     39    <?php bp_nouveau_user_feedback( 'member-invitations-not-allowed' ); ?>
     40
     41<?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.