Skip to:
Content

BuddyPress.org

Changeset 13762


Ignore:
Timestamp:
03/09/2024 10:55:43 AM (15 months ago)
Author:
imath
Message:

BP Standalone Block Themes: adapt Groups template hierarchy

  • Adds a members/single/index.html root template to the BP Standalone Theme hierarchy to be used by BP Standalone Block Themes in respect of WP Block Themes templating logic.
  • Adds a groups/single/index.html root template to the BP Standalone Theme hierarchy to be used by BP Standalone Block Themes in respect of WP Block Themes templating logic.

See #9118
See https://github.com/buddypress/buddypress/pull/249
See https://github.com/buddypress/buddyvibes/pull/7

Location:
trunk/src/bp-groups
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/actions/create.php

    r13449 r13762  
    1313 * @since 1.2.0
    1414 *
    15  * @return bool
     15 * @return void
    1616 */
    1717function groups_action_create_group() {
     
    1919    // If we're not at domain.org/groups/create/ then return false.
    2020    if ( ! bp_is_groups_component() || ! bp_is_current_action( 'create' ) ) {
    21         return false;
     21        return;
    2222    }
    2323
    2424    if ( ! is_user_logged_in() ) {
    25         return false;
     25        return;
    2626    }
    2727
  • trunk/src/bp-groups/actions/join.php

    r13437 r13762  
    1313 * @since 1.0.0
    1414 *
    15  * @return bool
     15 * @return void
    1616 */
    1717function groups_action_join_group() {
    1818
    19     if ( !bp_is_single_item() || !bp_is_groups_component() || !bp_is_current_action( 'join' ) )
    20         return false;
     19    if ( ! bp_is_single_item() || ! bp_is_groups_component() || ! bp_is_current_action( 'join' ) ) {
     20        return;
     21    }
    2122
    2223    // Nonce check.
    23     if ( !check_admin_referer( 'groups_join_group' ) )
    24         return false;
     24    if ( ! check_admin_referer( 'groups_join_group' ) ) {
     25        return;
     26    }
    2527
    2628    $bp = buddypress();
    2729
    2830    // Skip if banned or already a member.
    29     if ( !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) && !groups_is_user_banned( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
     31    if ( ! groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) && ! groups_is_user_banned( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
    3032
    3133        // User wants to join a group that requires an invitation to join.
    3234        if ( ! bp_current_user_can( 'groups_join_group', array( 'group_id' => $bp->groups->current_group->id ) ) ) {
    33             if ( !groups_check_user_has_invite( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
     35            if ( ! groups_check_user_has_invite( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
    3436                bp_core_add_message( __( 'There was an error joining the group.', 'buddypress' ), 'error' );
    3537                bp_core_redirect( bp_get_group_url( $bp->groups->current_group ) );
     
    3840
    3941        // User wants to join any group.
    40         if ( !groups_join_group( $bp->groups->current_group->id ) )
     42        if ( ! groups_join_group( $bp->groups->current_group->id ) ) {
    4143            bp_core_add_message( __( 'There was an error joining the group.', 'buddypress' ), 'error' );
    42         else
     44        } else {
    4345            bp_core_add_message( __( 'You joined the group!', 'buddypress' ) );
     46        }
    4447
    4548        bp_core_redirect( bp_get_group_url( $bp->groups->current_group ) );
    4649    }
    4750
    48     /**
    49      * Filters the template to load for the single group screen.
    50      *
    51      * @since 1.0.0
    52      *
    53      * @param string $value Path to the single group template to load.
    54      */
    55     bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
     51    $templates = array(
     52        /**
     53         * Filters the template to load for the single group screen.
     54         *
     55         * @since 1.0.0
     56         *
     57         * @param string $value Path to the single group template to load.
     58         */
     59        apply_filters( 'groups_template_group_home', 'groups/single/home' ),
     60        'groups/single/index',
     61    );
     62
     63    bp_core_load_template( $templates );
    5664}
    5765add_action( 'bp_actions', 'groups_action_join_group' );
  • trunk/src/bp-groups/actions/leave-group.php

    r13503 r13762  
    1919 * @since 1.2.4
    2020 *
    21  * @return bool
     21 * @return void
    2222 */
    2323function groups_action_leave_group() {
    2424    if ( ! bp_is_single_item() || ! bp_is_groups_component() || ! bp_is_current_action( 'leave-group' ) ) {
    25         return false;
     25        return;
    2626    }
    2727
    2828    // Nonce check.
    2929    if ( ! check_admin_referer( 'groups_leave_group' ) ) {
    30         return false;
     30        return;
    3131    }
    3232
     
    5656    }
    5757
    58     /** This filter is documented in bp-groups/bp-groups-actions.php */
    59     bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
     58    $templates = array(
     59        /** This filter is documented in bp-groups/actions/join.php */
     60        apply_filters( 'groups_template_group_home', 'groups/single/home' ),
     61        'groups/single/index',
     62    );
     63
     64    bp_core_load_template( $templates );
    6065}
    6166add_action( 'bp_actions', 'groups_action_leave_group' );
  • trunk/src/bp-groups/screens/single/activity-permalink.php

    r11923 r13762  
    1515 *
    1616 * @since 1.2.0
     17 *
     18 * @return void
    1719 */
    1820function groups_screen_group_activity_permalink() {
    19     if ( !bp_is_groups_component() || !bp_is_active( 'activity' ) || ( bp_is_active( 'activity' ) && !bp_is_current_action( bp_get_activity_slug() ) ) || !bp_action_variable( 0 ) )
    20         return false;
     21    if ( ! bp_is_groups_component() || ! bp_is_active( 'activity' ) || ( bp_is_active( 'activity' ) && ! bp_is_current_action( bp_get_activity_slug() ) ) || ! bp_action_variable( 0 ) ) {
     22        return;
     23    }
    2124
    2225    buddypress()->is_single_item = true;
    2326
    24     /** This filter is documented in bp-groups/bp-groups-screens.php */
    25     bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
     27    $templates = array(
     28        /** This filter is documented in bp-groups/screens/home.php */
     29        apply_filters( 'groups_template_group_home', 'groups/single/home' ),
     30        'groups/single/index',
     31    );
     32
     33    bp_core_load_template( $templates );
    2634}
    2735add_action( 'bp_screens', 'groups_screen_group_activity_permalink' );
  • trunk/src/bp-groups/screens/single/activity.php

    r11923 r13762  
    1212 *
    1313 * @since 2.4.0
     14 *
     15 * @return void
    1416 */
    1517function groups_screen_group_activity() {
    1618
    1719    if ( ! bp_is_single_item() ) {
    18         return false;
     20        return;
    1921    }
    2022
     
    2628    do_action( 'groups_screen_group_activity' );
    2729
    28     /**
    29      * Filters the template to load for a single group's activity page.
    30      *
    31      * @since 2.4.0
    32      *
    33      * @param string $value Path to a single group's template to load.
    34      */
    35     bp_core_load_template( apply_filters( 'groups_screen_group_activity', 'groups/single/activity' ) );
     30    $templates = array(
     31        /**
     32         * Filters the template to load for a single group's activity page.
     33         *
     34         * @since 2.4.0
     35         *
     36         * @param string $value Path to a single group's template to load.
     37         */
     38        apply_filters( 'groups_screen_group_activity', 'groups/single/activity' ),
     39        'groups/single/index',
     40    );
     41
     42    bp_core_load_template( $templates );
    3643}
  • trunk/src/bp-groups/screens/single/admin/delete-group.php

    r13503 r13762  
    1212 *
    1313 * @since 1.0.0
     14 *
     15 * @return void
    1416 */
    1517function groups_screen_group_admin_delete_group() {
    1618
    1719    if ( 'delete-group' != bp_get_group_current_admin_tab() ) {
    18         return false;
     20        return;
    1921    }
    2022
    2123    if ( ! bp_is_item_admin() && ! bp_current_user_can( 'bp_moderate' ) ) {
    22         return false;
     24        return;
    2325    }
    2426
     
    3133        // Check the nonce first.
    3234        if ( ! check_admin_referer( 'groups_delete_group' ) ) {
    33             return false;
     35            return;
    3436        }
    3537
     
    7173    do_action( 'groups_screen_group_admin_delete_group', $bp->groups->current_group->id );
    7274
    73     /**
    74      * Filters the template to load for the Delete Group page.
    75      *
    76      * @since 1.0.0
    77      *
    78      * @param string $value Path to the Delete Group template.
    79      */
    80     bp_core_load_template( apply_filters( 'groups_template_group_admin_delete_group', 'groups/single/home' ) );
     75    $templates = array(
     76        /**
     77         * Filters the template to load for the Delete Group page.
     78         *
     79         * @since 1.0.0
     80         *
     81         * @param string $value Path to the Delete Group template.
     82         */
     83        apply_filters( 'groups_template_group_admin_delete_group', 'groups/single/home' ),
     84        'groups/single/index',
     85    );
     86
     87    bp_core_load_template( $templates );
    8188}
    8289add_action( 'bp_screens', 'groups_screen_group_admin_delete_group' );
  • trunk/src/bp-groups/screens/single/admin/edit-details.php

    r13446 r13762  
    1212 *
    1313 * @since 1.0.0
     14 *
     15 * @return void
    1416 */
    1517function groups_screen_group_admin_edit_details() {
    1618
    17     if ( 'edit-details' != bp_get_group_current_admin_tab() )
    18         return false;
     19    if ( 'edit-details' !== bp_get_group_current_admin_tab() ) {
     20        return;
     21    }
    1922
    2023    if ( bp_is_item_admin() ) {
     
    2528        if ( isset( $_POST['save'] ) ) {
    2629            // Check the nonce.
    27             if ( !check_admin_referer( 'groups_edit_group_details' ) )
    28                 return false;
     30            if ( ! check_admin_referer( 'groups_edit_group_details' ) ) {
     31                return;
     32            }
    2933
    3034            $group_notify_members = isset( $_POST['group-notify-members'] ) ? (int) $_POST['group-notify-members'] : 0;
     
    7175        do_action( 'groups_screen_group_admin_edit_details', $bp->groups->current_group->id );
    7276
    73         /**
    74          * Filters the template to load for a group's admin/edit-details page.
    75          *
    76          * @since 1.0.0
    77          *
    78          * @param string $value Path to a group's admin/edit-details template.
    79          */
    80         bp_core_load_template( apply_filters( 'groups_template_group_admin', 'groups/single/home' ) );
     77        $templates = array(
     78            /**
     79             * Filters the template to load for a group's admin/edit-details page.
     80             *
     81             * @since 1.0.0
     82             *
     83             * @param string $value Path to a group's admin/edit-details template.
     84             */
     85            apply_filters( 'groups_template_group_admin', 'groups/single/home' ),
     86            'groups/single/index',
     87        );
     88
     89        bp_core_load_template( $templates );
    8190    }
    8291}
  • trunk/src/bp-groups/screens/single/admin/group-avatar.php

    r13177 r13762  
    1212 *
    1313 * @since 1.0.0
     14 *
     15 * @return void
    1416 */
    1517function groups_screen_group_admin_avatar() {
    1618
    17     if ( 'group-avatar' != bp_get_group_current_admin_tab() )
    18         return false;
     19    if ( 'group-avatar' !== bp_get_group_current_admin_tab() ) {
     20        return;
     21    }
    1922
    2023    // If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here.
    21     if ( ! bp_is_item_admin() || bp_disable_group_avatar_uploads() || ! buddypress()->avatar->show_avatars )
    22         return false;
     24    if ( ! bp_is_item_admin() || bp_disable_group_avatar_uploads() || ! buddypress()->avatar->show_avatars ) {
     25        return;
     26    }
    2327
    2428    $bp = buddypress();
     
    4347    $bp->avatar_admin->step = 'upload-image';
    4448
    45     if ( !empty( $_FILES ) ) {
     49    if ( ! empty( $_FILES ) ) {
    4650
    4751        // Check the nonce.
     
    105109    do_action( 'groups_screen_group_admin_avatar', $bp->groups->current_group->id );
    106110
    107     /**
    108      * Filters the template to load for a group's Change Avatar page.
    109      *
    110      * @since 1.0.0
    111      *
    112      * @param string $value Path to a group's Change Avatar template.
    113      */
    114     bp_core_load_template( apply_filters( 'groups_template_group_admin_avatar', 'groups/single/home' ) );
     111    $templates = array(
     112        /**
     113         * Filters the template to load for a group's Change Avatar page.
     114         *
     115         * @since 1.0.0
     116         *
     117         * @param string $value Path to a group's Change Avatar template.
     118         */
     119        apply_filters( 'groups_template_group_admin_avatar', 'groups/single/home' ),
     120        'groups/single/index',
     121    );
     122
     123    bp_core_load_template( $templates );
    115124}
    116125add_action( 'bp_screens', 'groups_screen_group_admin_avatar' );
  • trunk/src/bp-groups/screens/single/admin/group-cover-image.php

    r11923 r13762  
    1212 *
    1313 * @since 2.4.0
     14 *
     15 * @return void
    1416 */
    1517function groups_screen_group_admin_cover_image() {
    1618    if ( 'group-cover-image' != bp_get_group_current_admin_tab() ) {
    17         return false;
     19        return;
    1820    }
    1921
    2022    // If the logged-in user doesn't have permission or if cover image uploads are disabled, then stop here.
    2123    if ( ! bp_is_item_admin() || ! bp_group_use_cover_image_header() ) {
    22         return false;
     24        return;
    2325    }
    2426
     
    3234    do_action( 'groups_screen_group_admin_cover_image', bp_get_current_group_id() );
    3335
    34     /**
    35      * Filters the template to load for a group's Change cover image page.
    36      *
    37      * @since 2.4.0
    38      *
    39      * @param string $value Path to a group's Change cover image template.
    40      */
    41     bp_core_load_template( apply_filters( 'groups_template_group_admin_cover_image', 'groups/single/home' ) );
     36    $templates = array(
     37        /**
     38         * Filters the template to load for a group's Change cover image page.
     39         *
     40         * @since 2.4.0
     41         *
     42         * @param string $value Path to a group's Change cover image template.
     43         */
     44        apply_filters( 'groups_template_group_admin_cover_image', 'groups/single/home' ),
     45        'groups/single/index',
     46    );
     47
     48    bp_core_load_template( $templates );
    4249}
    4350add_action( 'bp_screens', 'groups_screen_group_admin_cover_image' );
  • trunk/src/bp-groups/screens/single/admin/group-settings.php

    r13446 r13762  
    1212 *
    1313 * @since 1.0.0
     14 *
     15 * @return void
    1416 */
    1517function groups_screen_group_admin_settings() {
    1618
    17     if ( 'group-settings' != bp_get_group_current_admin_tab() )
    18         return false;
     19    if ( 'group-settings' !== bp_get_group_current_admin_tab() ) {
     20        return;
     21    }
    1922
    20     if ( ! bp_is_item_admin() )
    21         return false;
     23    if ( ! bp_is_item_admin() ) {
     24        return;
     25    }
    2226
    2327    $bp = buddypress();
     
    3842
    3943        // Check the nonce.
    40         if ( !check_admin_referer( 'groups_edit_group_settings' ) )
    41             return false;
     44        if ( ! check_admin_referer( 'groups_edit_group_settings' ) ) {
     45            return;
     46        }
    4247
    4348        $group_id = bp_get_current_group_id();
     
    101106    do_action( 'groups_screen_group_admin_settings', $bp->groups->current_group->id );
    102107
    103     /**
    104      * Filters the template to load for a group's admin/group-settings page.
    105      *
    106      * @since 1.0.0
    107      *
    108      * @param string $value Path to a group's admin/group-settings template.
    109      */
    110     bp_core_load_template( apply_filters( 'groups_template_group_admin_settings', 'groups/single/home' ) );
     108    $templates = array(
     109        /**
     110         * Filters the template to load for a group's admin/group-settings page.
     111         *
     112         * @since 1.0.0
     113         *
     114         * @param string $value Path to a group's admin/group-settings template.
     115         */
     116        apply_filters( 'groups_template_group_admin_settings', 'groups/single/home' ),
     117        'groups/single/index',
     118    );
     119
     120    bp_core_load_template( $templates );
    111121}
    112122add_action( 'bp_screens', 'groups_screen_group_admin_settings' );
  • trunk/src/bp-groups/screens/single/admin/manage-members.php

    r13446 r13762  
    1212 *
    1313 * @since 1.0.0
     14 *
     15 * @return void
    1416 */
    1517function groups_screen_group_admin_manage_members() {
    1618
    1719    if ( 'manage-members' != bp_get_group_current_admin_tab() ) {
    18         return false;
     20        return;
    1921    }
    2022
    2123    if ( ! bp_is_item_admin() ) {
    22         return false;
     24        return;
    2325    }
    2426
     
    3638            // Check the nonce first.
    3739            if ( ! check_admin_referer( 'groups_promote_member' ) ) {
    38                 return false;
     40                return;
    3941            }
    4042
     
    6668            // Check the nonce first.
    6769            if ( ! check_admin_referer( 'groups_demote_member' ) ) {
    68                 return false;
     70                return;
    6971            }
    7072
     
    99101            // Check the nonce first.
    100102            if ( ! check_admin_referer( 'groups_ban_member' ) ) {
    101                 return false;
     103                return;
    102104            }
    103105
     
    127129            // Check the nonce first.
    128130            if ( ! check_admin_referer( 'groups_unban_member' ) ) {
    129                 return false;
     131                return;
    130132            }
    131133
     
    155157            // Check the nonce first.
    156158            if ( ! check_admin_referer( 'groups_remove_member' ) ) {
    157                 return false;
     159                return;
    158160            }
    159161
     
    188190    do_action( 'groups_screen_group_admin_manage_members', $bp->groups->current_group->id );
    189191
    190     /**
    191      * Filters the template to load for a group's manage members page.
    192      *
    193      * @since 1.0.0
    194      *
    195      * @param string $value Path to a group's manage members template.
    196      */
    197     bp_core_load_template( apply_filters( 'groups_template_group_admin_manage_members', 'groups/single/home' ) );
     192    $templates = array(
     193        /**
     194         * Filters the template to load for a group's manage members page.
     195         *
     196         * @since 1.0.0
     197         *
     198         * @param string $value Path to a group's manage members template.
     199         */
     200        apply_filters( 'groups_template_group_admin_manage_members', 'groups/single/home' ),
     201        'groups/single/index',
     202    );
     203
     204    bp_core_load_template( $templates );
    198205}
    199206add_action( 'bp_screens', 'groups_screen_group_admin_manage_members' );
  • trunk/src/bp-groups/screens/single/admin/membership-requests.php

    r13446 r13762  
    1212 *
    1313 * @since 1.0.0
     14 *
     15 * @return void
    1416 */
    1517function groups_screen_group_admin_requests() {
     
    1719
    1820    if ( 'membership-requests' != bp_get_group_current_admin_tab() ) {
    19         return false;
     21        return;
    2022    }
    2123
    22     if ( ! bp_is_item_admin() || ( 'public' == $bp->groups->current_group->status ) ) {
    23         return false;
     24    if ( ! bp_is_item_admin() || ( 'public' === $bp->groups->current_group->status ) ) {
     25        return;
    2426    }
    2527
     
    3335            // Check the nonce first.
    3436            if ( ! check_admin_referer( 'groups_accept_membership_request' ) ) {
    35                 return false;
     37                return;
    3638            }
    3739
     
    4648            /* Check the nonce first. */
    4749            if ( ! check_admin_referer( 'groups_reject_membership_request' ) ) {
    48                 return false;
     50                return;
    4951            }
    5052
     
    9092    do_action( 'groups_screen_group_admin_requests', $bp->groups->current_group->id );
    9193
    92     /**
    93      * Filters the template to load for a group's membership request page.
    94      *
    95      * @since 1.0.0
    96      *
    97      * @param string $value Path to a group's membership request template.
    98      */
    99     bp_core_load_template( apply_filters( 'groups_template_group_admin_requests', 'groups/single/home' ) );
     94    $templates = array(
     95        /**
     96         * Filters the template to load for a group's membership request page.
     97         *
     98         * @since 1.0.0
     99         *
     100         * @param string $value Path to a group's membership request template.
     101         */
     102        apply_filters( 'groups_template_group_admin_requests', 'groups/single/home' ),
     103        'groups/single/index',
     104    );
     105
     106    bp_core_load_template( $templates );
    100107}
    101108add_action( 'bp_screens', 'groups_screen_group_admin_requests' );
  • trunk/src/bp-groups/screens/single/home.php

    r11923 r13762  
    1212 *
    1313 * @since 1.0.0
     14 *
     15 * @return void
    1416 */
    1517function groups_screen_group_home() {
    1618
    1719    if ( ! bp_is_single_item() ) {
    18         return false;
     20        return;
    1921    }
    2022
     
    2628    do_action( 'groups_screen_group_home' );
    2729
    28     /**
    29      * Filters the template to load for a single group's page.
    30      *
    31      * @since 1.0.0
    32      *
    33      * @param string $value Path to a single group's template to load.
    34      */
    35     bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
     30    $templates = array(
     31        /**
     32         * Filters the template to load for a single group's page.
     33         *
     34         * @since 1.0.0
     35         *
     36         * @param string $value Path to a single group's template to load.
     37         */
     38        apply_filters( 'groups_template_group_home', 'groups/single/home' ),
     39        'groups/single/index',
     40    );
     41
     42    bp_core_load_template( $templates );
    3643}
  • trunk/src/bp-groups/screens/single/members.php

    r13103 r13762  
    1212 *
    1313 * @since 1.0.0
     14 *
     15 * @return void
    1416 */
    1517function groups_screen_group_members() {
    1618
    1719    if ( ! bp_is_single_item() ) {
    18         return false;
     20        return;
    1921    }
    2022
     
    3032    do_action( 'groups_screen_group_members', $bp->groups->current_group->id );
    3133
    32     /**
    33      * Filters the template to load for a group's Members page.
    34      *
    35      * @since 1.0.0
    36      *
    37      * @param string $value Path to a group's Members template.
    38      */
    39     bp_core_load_template( apply_filters( 'groups_template_group_members', 'groups/single/home' ) );
     34    $templates = array(
     35        /**
     36         * Filters the template to load for a group's Members page.
     37         *
     38         * @since 1.0.0
     39         *
     40         * @param string $value Path to a group's Members template.
     41         */
     42        apply_filters( 'groups_template_group_members', 'groups/single/home' ),
     43        'groups/single/index',
     44    );
     45
     46    bp_core_load_template( $templates );
    4047}
  • trunk/src/bp-groups/screens/single/request-membership.php

    r13437 r13762  
    1212 *
    1313 * @since 1.0.0
     14 *
     15 * @return void
    1416 */
    1517function groups_screen_group_request_membership() {
    1618
    1719    if ( ! is_user_logged_in() ) {
    18         return false;
     20        return;
    1921    }
    2022
     
    2224
    2325    if ( 'private' != $bp->groups->current_group->status ) {
    24         return false;
     26        return;
    2527    }
    2628
     
    4143        // Check the nonce.
    4244        if ( ! check_admin_referer( 'groups_request_membership' ) ) {
    43             return false;
     45            return;
    4446        }
    4547
     
    6062            bp_core_add_message( __( 'Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request.', 'buddypress' ) );
    6163        }
     64
    6265        bp_core_redirect( bp_get_group_url( $bp->groups->current_group ) );
    6366    }
     
    7275    do_action( 'groups_screen_group_request_membership', $bp->groups->current_group->id );
    7376
    74     /**
    75      * Filters the template to load for a group's Request Membership page.
    76      *
    77      * @since 1.0.0
    78      *
    79      * @param string $value Path to a group's Request Membership template.
    80      */
    81     bp_core_load_template( apply_filters( 'groups_template_group_request_membership', 'groups/single/home' ) );
     77    $templates = array(
     78        /**
     79         * Filters the template to load for a group's Request Membership page.
     80         *
     81         * @since 1.0.0
     82         *
     83         * @param string $value Path to a group's Request Membership template.
     84         */
     85        apply_filters( 'groups_template_group_request_membership', 'groups/single/home' ),
     86        'groups/single/index',
     87    );
     88
     89    bp_core_load_template( $templates );
    8290}
  • trunk/src/bp-groups/screens/single/send-invites.php

    r13437 r13762  
    1212 *
    1313 * @since 1.0.0
     14 *
     15 * @return void
    1416 */
    1517function groups_screen_group_invite() {
    1618
    17     if ( !bp_is_single_item() )
    18         return false;
     19    if ( ! bp_is_single_item() ) {
     20        return;
     21    }
    1922
    2023    $bp = buddypress();
     
    2225    if ( bp_is_action_variable( 'send', 0 ) ) {
    2326
    24         if ( !check_admin_referer( 'groups_send_invites', '_wpnonce_send_invites' ) )
    25             return false;
     27        if ( ! check_admin_referer( 'groups_send_invites', '_wpnonce_send_invites' ) ) {
     28            return;
     29        }
    2630
    27         if ( !empty( $_POST['friends'] ) ) {
     31        if ( ! empty( $_POST['friends'] ) ) {
    2832            foreach( (array) $_POST['friends'] as $friend ) {
    2933                groups_invite_user( array( 'user_id' => $friend, 'group_id' => $bp->groups->current_group->id ) );
     
    4549        bp_core_redirect( bp_get_group_url( $bp->groups->current_group ) );
    4650
    47     } elseif ( !bp_action_variable( 0 ) ) {
     51    } elseif ( ! bp_action_variable( 0 ) ) {
    4852
    49         /**
    50          * Filters the template to load for a group's Send Invites page.
    51          *
    52          * @since 1.0.0
    53          *
    54          * @param string $value Path to a group's Send Invites template.
    55          */
    56         bp_core_load_template( apply_filters( 'groups_template_group_invite', 'groups/single/home' ) );
     53        $templates = array(
     54            /**
     55             * Filters the template to load for a group's Send Invites page.
     56             *
     57             * @since 1.0.0
     58             *
     59             * @param string $value Path to a group's Send Invites template.
     60             */
     61            apply_filters( 'groups_template_group_invite', 'groups/single/home' ),
     62            'groups/single/index',
     63        );
     64
     65        bp_core_load_template( $templates );
    5766
    5867    } else {
     
    6877 *
    6978 * @since 2.0.0
     79 *
     80 * @return void
    7081 */
    7182function groups_remove_group_invite() {
     
    7990
    8091    if ( ! check_admin_referer( 'groups_invite_uninvite_user' ) ) {
    81         return false;
     92        return;
    8293    }
    8394
  • trunk/src/bp-groups/screens/user/invites.php

    r13482 r13762  
    1212 *
    1313 * @since 1.0.0
     14 *
     15 * @return void
    1416 */
    1517function groups_screen_group_invites() {
     
    1921        // Check the nonce.
    2022        if ( ! check_admin_referer( 'groups_accept_invite' ) ) {
    21             return false;
     23            return;
    2224        }
    2325
     
    5052    } elseif ( bp_is_action_variable( 'reject' ) && is_numeric( $group_id ) ) {
    5153        // Check the nonce.
    52         if ( !check_admin_referer( 'groups_reject_invite' ) )
    53             return false;
     54        if ( ! check_admin_referer( 'groups_reject_invite' ) )
     55            return;
    5456
    5557        if ( ! groups_reject_invite( bp_displayed_user_id(), $group_id ) ) {
     
    7880    do_action( 'groups_screen_group_invites', $group_id );
    7981
    80     /**
    81      * Filters the template to load for a users Groups > Invites page.
    82      *
    83      * @since 1.0.0
    84      *
    85      * @param string $value Path to a users Groups > Invites page template.
    86      */
    87     bp_core_load_template( apply_filters( 'groups_template_group_invites', 'members/single/home' ) );
     82    $templates = array(
     83        /**
     84         * Filters the template to load for a users Groups > Invites page.
     85         *
     86         * @since 1.0.0
     87         *
     88         * @param string $value Path to a users Groups > Invites page template.
     89         */
     90        apply_filters( 'groups_template_group_invites', 'members/single/home' ),
     91        'members/single/index',
     92    );
     93
     94    bp_core_load_template( $templates );
    8895}
  • trunk/src/bp-groups/screens/user/my-groups.php

    r11923 r13762  
    2222    do_action( 'groups_screen_my_groups' );
    2323
    24     /**
    25      * Filters the template to load for the My Groups page.
    26      *
    27      * @since 1.0.0
    28      *
    29      * @param string $value Path to the My Groups page template to load.
    30      */
    31     bp_core_load_template( apply_filters( 'groups_template_my_groups', 'members/single/home' ) );
     24    $templates = array(
     25        /**
     26         * Filters the template to load for the My Groups page.
     27         *
     28         * @since 1.0.0
     29         *
     30         * @param string $value Path to the My Groups page template to load.
     31         */
     32        apply_filters( 'groups_template_my_groups', 'members/single/home' ),
     33        'members/single/index',
     34    );
     35
     36    bp_core_load_template( $templates );
    3237}
Note: See TracChangeset for help on using the changeset viewer.