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-legacy/buddypress/members/single/invitations/send-invites.php

    r12922 r12946  
    1414    ?>
    1515</h2>
     16
     17<?php if ( bp_user_can( bp_displayed_user_id(), 'bp_members_send_invitation' ) ) : ?>
    1618
    1719<form class="standard-form members-invitation-form" id="members-invitation-form" method="post">
     
    3133    </p>
    3234</form>
     35
     36<?php else : ?>
     37
     38    <p class="bp-feedback error">
     39        <span class="bp-icon" aria-hidden="true"></span>
     40        <span class="bp-help-text">
     41            <?php echo apply_filters( 'members_invitations_form_access_restricted', esc_html__( 'Sorry, you are not allowed to send invitations.', 'buddypress' ) ); ?>
     42        </span>
     43    </p>
     44
     45<?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.