Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/28/2021 11:50:34 PM (6 months ago)
Author:
dcavins
Message:

Member Invites: Add core template functions.

Add class BP_Members_Invitations_Template and
template functions in BP_Members_Template.

See #8139.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-template.php

    r12769 r12919  
    22492249
    22502250/**
     2251 * Check whether the current page is an Invitations screen.
     2252 *
     2253 * @since 8.0.0
     2254 *
     2255 * @return bool True if the current page is an Invitations screen.
     2256 */
     2257function bp_is_members_invitations_screen() {
     2258    return (bool) bp_is_current_component( bp_get_members_invitations_slug() );
     2259}
     2260
     2261/**
    22512262 * Is the current component an active core component?
    22522263 *
     
    26462657function bp_is_user_settings_profile() {
    26472658    return (bool) ( bp_is_user_settings() && bp_is_current_action( 'profile' ) );
     2659}
     2660
     2661/**
     2662 * Is the current page a user's community invitations page?
     2663 *
     2664 * Eg http://example.com/members/cassie/invitations/ (or a subpage thereof).
     2665 *
     2666 * @since 8.0.0
     2667 *
     2668 * @return bool True if the current page is a user's community invitations page.
     2669 */
     2670function bp_is_user_members_invitations() {
     2671    return (bool) ( bp_is_user() && bp_is_members_invitations_screen() );
     2672}
     2673
     2674/**
     2675 * Is the current page a user's List Invites page?
     2676 *
     2677 * Eg http://example.com/members/cassie/invitations/list-invites/.
     2678 *
     2679 * @since 8.0.0
     2680 *
     2681 * @return bool True if the current page is a user's List Invites page.
     2682 */
     2683function bp_is_user_members_invitations_list() {
     2684    return (bool) ( bp_is_user_members_invitations() && bp_is_current_action( 'list-invites' ) );
     2685}
     2686
     2687/**
     2688 * Is the current page a user's Send Invites page?
     2689 *
     2690 * Eg http://example.com/members/cassie/invitations/send-invites/.
     2691 *
     2692 * @since 8.0.0
     2693 *
     2694 * @return bool True if the current page is a user's Send Invites page.
     2695 */
     2696function bp_is_user_members_invitations_send_screen() {
     2697    return (bool) ( bp_is_user_members_invitations() && bp_is_current_action( 'send-invites' ) );
    26482698}
    26492699
Note: See TracChangeset for help on using the changeset viewer.