Skip to:
Content

BuddyPress.org

Changeset 13763


Ignore:
Timestamp:
03/09/2024 10:59:45 AM (2 years ago)
Author:
imath
Message:

BP Standalone Block Themes: adapt Members 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 members/register 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 members/activate 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-members/screens
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/screens/activate.php

    r13436 r13763  
    1212 *
    1313 * @since 1.1.0
     14 *
     15 * @return void
    1416 */
    1517function bp_core_screen_activation() {
     
    1719        // Bail if not viewing the activation page.
    1820        if ( ! bp_is_current_component( 'activate' ) ) {
    19                 return false;
     21                return;
    2022        }
    2123
     
    5355         * @since 1.1.1
    5456         *
    55          * @param string $value Path to the Member activation template to load.
     57         * @param string[] $value Path to the list of Member activation template to load.
    5658         */
    57         bp_core_load_template( apply_filters( 'bp_core_template_activate', array( 'activate', 'registration/activate' ) ) );
     59        $templates   = apply_filters( 'bp_core_template_activate', array( 'activate', 'registration/activate' ) );
     60        $templates[] = 'members/activate';
     61
     62        bp_core_load_template( $templates );
    5863}
    5964add_action( 'bp_screens', 'bp_core_screen_activation' );
  • trunk/src/bp-members/screens/change-avatar.php

    r13443 r13763  
    1212 *
    1313 * @since 6.0.0
     14 *
     15 * @return void
    1416 */
    1517function bp_members_screen_change_avatar() {
    1618        // Bail if not the correct screen.
    1719        if ( ! bp_is_my_profile() && ! bp_current_user_can( 'bp_moderate' ) ) {
    18                 return false;
     20                return;
    1921        }
    2022
     
    3335        $bp->avatar_admin->step = 'upload-image';
    3436
    35         if ( !empty( $_FILES ) ) {
     37        if ( ! empty( $_FILES ) ) {
    3638
    3739                // Check the nonce.
     
    100102        do_action( 'bp_members_screen_change_avatar' );
    101103
    102         /** This filter is documented in wp-includes/deprecated.php */
    103         $template = apply_filters_deprecated( 'xprofile_template_change_avatar', array( 'members/single/home' ), '6.0.0', 'bp_members_template_change_avatar' );
     104        $templates = array(
     105                /** This filter is documented in wp-includes/deprecated.php */
     106                apply_filters_deprecated( 'xprofile_template_change_avatar', array( 'members/single/home' ), '6.0.0', 'bp_members_template_change_avatar' ),
     107                'members/single/index'
     108        );
    104109
    105110        /**
     
    108113         * @since 6.0.0
    109114         *
    110          * @param string $template Path to the Member template to load.
     115         * @param string[] $templates Path to the Member templates to load.
    111116         */
    112         bp_core_load_template( apply_filters( 'bp_members_template_change_avatar', $template ) );
     117        bp_core_load_template( apply_filters( 'bp_members_template_change_avatar', $templates ) );
    113118}
  • trunk/src/bp-members/screens/change-cover-image.php

    r12558 r13763  
    2929        do_action( 'bp_members_screen_change_cover_image' );
    3030
    31         /** This filter is documented in wp-includes/deprecated.php */
    32         $template = apply_filters_deprecated( 'xprofile_template_cover_image', array( 'members/single/home' ), '6.0.0', 'bp_members_template_change_cover_image' );
     31        $templates = array(
     32                /** This filter is documented in wp-includes/deprecated.php */
     33                apply_filters_deprecated( 'xprofile_template_cover_image', array( 'members/single/home' ), '6.0.0', 'bp_members_template_change_cover_image' ),
     34                'members/single/index',
     35        );
    3336
    3437        /**
     
    3740         * @since 6.0.0
    3841         *
    39          * @param string $template Path to the Member template to load.
     42         * @param string[] $templates Path to the list of Member templates to load.
    4043         */
    41         bp_core_load_template( apply_filters( 'bp_members_template_change_cover_image', $template ) );
     44        bp_core_load_template( apply_filters( 'bp_members_template_change_cover_image', $templates ) );
    4245}
  • trunk/src/bp-members/screens/invitations.php

    r13108 r13763  
    5252        do_action( 'members_screen_send_invites' );
    5353
    54         /**
    55          * Filters the template used to display the send membership invitations page.
    56          *
    57          * @since 8.0.0
    58          *
    59          * @param string $template Path to the send membership invitations template to load.
    60          */
    61         bp_core_load_template( apply_filters( 'members_template_send_invites', 'members/single/invitations' ) );
     54        $templates = array(
     55                /**
     56                 * Filters the template used to display the send membership invitations page.
     57                 *
     58                 * @since 8.0.0
     59                 *
     60                 * @param string $template Path to the send membership invitations template to load.
     61                 */
     62                apply_filters( 'members_template_send_invites', 'members/single/home' ),
     63                'members/single/index',
     64        );
     65
     66        bp_core_load_template( $templates );
    6267}
    6368
     
    113118        do_action( 'members_screen_list_sent_invites' );
    114119
    115         /**
    116          * Filters the template used to display the send membership invitations page.
    117          *
    118          * @since 8.0.0
    119          *
    120          * @param string $template Path to the send membership invitations template to load.
    121          */
    122         bp_core_load_template( apply_filters( 'members_template_list_sent_invites', 'members/single/invitations' ) );
     120        $templates = array(
     121                /**
     122                 * Filters the template used to display the send membership invitations page.
     123                 *
     124                 * @since 8.0.0
     125                 *
     126                 * @param string $template Path to the send membership invitations template to load.
     127                 */
     128                apply_filters( 'members_template_list_sent_invites', 'members/single/home' ),
     129                'members/single/index',
     130        );
     131
     132        bp_core_load_template( $templates );
    123133}
  • trunk/src/bp-members/screens/profile.php

    r12556 r13763  
    2222        do_action( 'bp_members_screen_display_profile' );
    2323
    24         /**
    25          * Filters the template to load for the Member profile page screen.
    26          *
    27          * @since 1.5.0
    28          *
    29          * @param string $template Path to the Member template to load.
    30          */
    31         bp_core_load_template( apply_filters( 'bp_members_screen_display_profile', 'members/single/home' ) );
     24        $templates = array(
     25                /**
     26                 * Filters the template to load for the Member profile page screen.
     27                 *
     28                 * @since 1.5.0
     29                 *
     30                 * @param string $template Path to the Member template to load.
     31                 */
     32                apply_filters( 'bp_members_screen_display_profile', 'members/single/home' ),
     33                'members/single/index',
     34        );
     35
     36        bp_core_load_template( $templates );
    3237}
  • trunk/src/bp-members/screens/register.php

    r13436 r13763  
    293293         * @since 1.5.0
    294294         *
    295          * @param string $value Path to the Member registration template to load.
     295         * @param string[] $value Path to the list of Member registration templates to load.
    296296         */
    297         bp_core_load_template( apply_filters( 'bp_core_template_register', array( 'register', 'registration/register' ) ) );
     297        $templates   = apply_filters( 'bp_core_template_register', array( 'register', 'registration/register' ) );
     298        $templates[] = 'members/register';
     299
     300        bp_core_load_template( $templates );
    298301}
    299302add_action( 'bp_screens', 'bp_core_screen_signup' );
Note: See TracChangeset for help on using the changeset viewer.