Skip to:
Content

BuddyPress.org

Changeset 13767


Ignore:
Timestamp:
03/09/2024 11:07:30 AM (2 years ago)
Author:
imath
Message:

BP Standalone Block Themes: adapt xProfiles 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.

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

Location:
trunk/src
Files:
4 edited

Legend:

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

    r13752 r13767  
    219219 */
    220220function bp_core_catch_profile_uri() {
    221     if ( !bp_is_active( 'xprofile' ) ) {
    222 
    223         /**
    224          * Filters the path to redirect users to if XProfile is not enabled.
    225          *
    226          * @since 1.0.0
    227          *
    228          * @param string $value Path to redirect users to.
    229          */
    230         bp_core_load_template( apply_filters( 'bp_core_template_display_profile', 'members/single/home' ) );
     221    if ( ! bp_is_active( 'xprofile' ) ) {
     222
     223        $templates = array(
     224            /**
     225             * Filters the path to redirect users to if XProfile is not enabled.
     226             *
     227             * @since 1.0.0
     228             *
     229             * @param string $value Path to redirect users to.
     230             */
     231            apply_filters( 'bp_core_template_display_profile', 'members/single/home' ),
     232            'members/single/index',
     233        );
     234
     235        bp_core_load_template( $templates );
    231236    }
    232237}
  • trunk/src/bp-xprofile/screens/edit.php

    r13503 r13767  
    1414 * @since 1.0.0
    1515 *
     16 * @return void
    1617 */
    1718function xprofile_screen_edit_profile() {
    1819
    1920    if ( ! bp_is_my_profile() && ! bp_current_user_can( 'bp_moderate' ) ) {
    20         return false;
     21        return;
    2122    }
    2223
     
    172173    do_action( 'xprofile_screen_edit_profile' );
    173174
    174     /**
    175      * Filters the template to load for the XProfile edit screen.
    176      *
    177      * @since 1.0.0
    178      *
    179      * @param string $template Path to the XProfile edit template to load.
    180      */
    181     bp_core_load_template( apply_filters( 'xprofile_template_edit_profile', 'members/single/home' ) );
     175    $templates = array(
     176        /**
     177         * Filters the template to load for the XProfile edit screen.
     178         *
     179         * @since 1.0.0
     180         *
     181         * @param string $template Path to the XProfile edit template to load.
     182         */
     183        apply_filters( 'xprofile_template_edit_profile', 'members/single/home' ),
     184        'members/single/index',
     185    );
     186
     187    bp_core_load_template( $templates );
    182188}
  • trunk/src/bp-xprofile/screens/public.php

    r11928 r13767  
    2626    do_action( 'xprofile_screen_display_profile', $new );
    2727
    28     /**
    29      * Filters the template to load for the XProfile screen.
    30      *
    31      * @since 1.0.0
    32      *
    33      * @param string $template Path to the XProfile template to load.
    34      */
    35     bp_core_load_template( apply_filters( 'xprofile_template_display_profile', 'members/single/home' ) );
     28    $templates = array(
     29        /**
     30         * Filters the template to load for the XProfile screen.
     31         *
     32         * @since 1.0.0
     33         *
     34         * @param string $template Path to the XProfile template to load.
     35         */
     36        apply_filters( 'xprofile_template_display_profile', 'members/single/home' ),
     37        'members/single/index',
     38    );
     39
     40    bp_core_load_template( $templates );
    3641}
  • trunk/src/bp-xprofile/screens/settings-profile.php

    r13503 r13767  
    1212 *
    1313 * @since 2.0.0
     14 *
     15 * @return void
    1416 */
    1517function bp_xprofile_screen_settings() {
     
    2123    }
    2224
    23     /**
    24      * Filters the template to load for the XProfile settings screen.
    25      *
    26      * @since 2.0.0
    27      *
    28      * @param string $template Path to the XProfile change avatar template to load.
    29      */
    30     bp_core_load_template( apply_filters( 'bp_settings_screen_xprofile', '/members/single/settings/profile' ) );
     25    $templates = array(
     26        /**
     27         * Filters the template to load for the XProfile settings screen.
     28         *
     29         * @since 2.0.0
     30         *
     31         * @param string $template Path to the XProfile change avatar template to load.
     32         */
     33        apply_filters( 'bp_settings_screen_xprofile', '/members/single/settings/profile' ),
     34        'members/single/index',
     35    );
     36
     37    bp_core_load_template( $templates );
    3138}
    3239
     
    3542 *
    3643 * @since 1.9.0
     44 *
     45 * @return void
    3746 */
    3847function bp_xprofile_action_settings() {
Note: See TracChangeset for help on using the changeset viewer.