Skip to:
Content

BuddyPress.org


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

BP Standalone Block Themes: adapt Notifications 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-notifications/screens/unread.php

    r13091 r13765  
    2222    do_action( 'bp_notifications_screen_unread' );
    2323
    24     /**
    25      * Filters the template to load for the notifications unread screen.
    26      *
    27      * @since 1.9.0
    28      *
    29      * @param string $template Path to the notifications unread template to load.
    30      */
    31     bp_core_load_template( apply_filters( 'bp_notifications_template_unread', 'members/single/home' ) );
     24    $templates = array(
     25        /**
     26         * Filters the template to load for the notifications unread screen.
     27         *
     28         * @since 1.9.0
     29         *
     30         * @param string $template Path to the notifications unread template to load.
     31         */
     32        apply_filters( 'bp_notifications_template_unread', 'members/single/home' ),
     33        'members/single/index',
     34    );
     35
     36    bp_core_load_template( $templates );
    3237}
    3338
     
    3742 * @since 1.9.0
    3843 *
    39  * @return bool
     44 * @return void
    4045 */
    4146function bp_notifications_action_mark_read() {
     
    4348    // Bail if not the unread screen.
    4449    if ( ! bp_is_notifications_component() || ! bp_is_current_action( 'unread' ) ) {
    45         return false;
     50        return;
    4651    }
    4752
    4853    // Get the action.
    49     $action = !empty( $_GET['action']          ) ? $_GET['action']          : '';
    50     $nonce  = !empty( $_GET['_wpnonce']        ) ? $_GET['_wpnonce']        : '';
    51     $id     = !empty( $_GET['notification_id'] ) ? $_GET['notification_id'] : '';
     54    $action = ! empty( $_GET['action']          ) ? $_GET['action']          : '';
     55    $nonce  = ! empty( $_GET['_wpnonce']        ) ? $_GET['_wpnonce']        : '';
     56    $id     = ! empty( $_GET['notification_id'] ) ? $_GET['notification_id'] : '';
    5257
    5358    // Bail if no action or no ID.
    5459    if ( ( 'read' !== $action ) || empty( $id ) || empty( $nonce ) ) {
    55         return false;
     60        return;
    5661    }
    5762
Note: See TracChangeset for help on using the changeset viewer.