Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/09/2024 11:01:57 AM (21 months ago)
Author:
imath
Message:

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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/screens/view.php

    r13503 r13764  
    1313 * @since 1.0.0
    1414 *
    15  * @return bool False on failure.
     15 * @return void.
    1616 */
    1717function messages_screen_conversation() {
     
    1919    // Bail if not viewing a single message.
    2020    if ( ! bp_is_messages_component() || ! bp_is_current_action( 'view' ) ) {
    21         return false;
     21        return;
    2222    }
    2323
     
    6262
    6363    // Edit the Navigation name.
    64     $bp->members->nav->edit_nav( array(
    65         'name' => $nav_name,
    66     ), $bp->messages->slug );
     64    $bp->members->nav->edit_nav(
     65        array(
     66            'name' => $nav_name,
     67        ),
     68        $bp->messages->slug
     69    );
    6770
    6871    /**
     
    7376    do_action( 'messages_screen_conversation' );
    7477
    75     /**
    76      * Filters the template to load for the Messages view screen.
    77      *
    78      * @since 1.0.0
    79      *
    80      * @param string $template Path to the messages template to load.
    81      */
    82     bp_core_load_template( apply_filters( 'messages_template_view_message', 'members/single/home' ) );
     78    $templates = array(
     79        /**
     80         * Filters the template to load for the Messages view screen.
     81         *
     82         * @since 1.0.0
     83         *
     84         * @param string $template Path to the messages template to load.
     85         */
     86        apply_filters( 'messages_template_view_message', 'members/single/home' ),
     87        'members/single/index',
     88    );
     89
     90    bp_core_load_template( $templates );
    8391}
    8492add_action( 'bp_screens', 'messages_screen_conversation' );
Note: See TracChangeset for help on using the changeset viewer.