Skip to:
Content

BuddyPress.org

Changeset 13759


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

BP Standalone Block Themes: adapt Activity 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 an activity/single 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-activity/screens
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/screens/favorites.php

    r11885 r13759  
    2323        do_action( 'bp_activity_screen_favorites' );
    2424
    25         /**
    26          * Filters the template to load for the "Favorites" screen.
    27          *
    28          * @since 1.2.0
    29          *
    30          * @param string $template Path to the activity template to load.
    31          */
    32         bp_core_load_template( apply_filters( 'bp_activity_template_favorite_activity', 'members/single/home' ) );
     25        $templates = array(
     26                /**
     27                 * Filters the template to load for the "Favorites" screen.
     28                 *
     29                 * @since 1.2.0
     30                 *
     31                 * @param string $template Path to the activity template to load.
     32                 */
     33                apply_filters( 'bp_activity_template_favorite_activity', 'members/single/home' ),
     34                'members/single/index',
     35        );
     36
     37
     38        bp_core_load_template( $templates );
    3339}
  • trunk/src/bp-activity/screens/friends.php

    r11885 r13759  
    1212 *
    1313 * @since 1.0.0
     14 *
     15 * @return void
    1416 */
    1517function bp_activity_screen_friends() {
    16         if ( !bp_is_active( 'friends' ) )
    17                 return false;
     18        if ( ! bp_is_active( 'friends' ) ) {
     19                return;
     20        }
    1821
    1922        bp_update_is_item_admin( bp_current_user_can( 'bp_moderate' ), 'activity' );
     
    2629        do_action( 'bp_activity_screen_friends' );
    2730
    28         /**
    29          * Filters the template to load for the "My Friends" screen.
    30          *
    31          * @since 1.0.0
    32          *
    33          * @param string $template Path to the activity template to load.
    34          */
    35         bp_core_load_template( apply_filters( 'bp_activity_template_friends_activity', 'members/single/home' ) );
     31        $templates = array(
     32                /**
     33                 * Filters the template to load for the "My Friends" screen.
     34                 *
     35                 * @since 1.0.0
     36                 *
     37                 * @param string $template Path to the activity template to load.
     38                 */
     39                apply_filters( 'bp_activity_template_friends_activity', 'members/single/home' ),
     40                'members/single/index',
     41        );
     42
     43        bp_core_load_template( $templates );
    3644}
  • trunk/src/bp-activity/screens/groups.php

    r11885 r13759  
    1212 *
    1313 * @since 1.2.0
     14 *
     15 * @return void
    1416 */
    1517function bp_activity_screen_groups() {
    16         if ( !bp_is_active( 'groups' ) )
    17                 return false;
     18        if ( ! bp_is_active( 'groups' ) ) {
     19                return;
     20        }
    1821
    1922        bp_update_is_item_admin( bp_current_user_can( 'bp_moderate' ), 'activity' );
     
    2629        do_action( 'bp_activity_screen_groups' );
    2730
    28         /**
    29          * Filters the template to load for the "My Groups" screen.
    30          *
    31          * @since 1.2.0
    32          *
    33          * @param string $template Path to the activity template to load.
    34          */
    35         bp_core_load_template( apply_filters( 'bp_activity_template_groups_activity', 'members/single/home' ) );
     31        $templates = array(
     32                /**
     33                 * Filters the template to load for the "My Groups" screen.
     34                 *
     35                 * @since 1.2.0
     36                 *
     37                 * @param string $template Path to the activity template to load.
     38                 */
     39                apply_filters( 'bp_activity_template_groups_activity', 'members/single/home' ),
     40                'members/single/index',
     41        );
     42
     43        bp_core_load_template( $templates );
    3644}
  • trunk/src/bp-activity/screens/just-me.php

    r11885 r13759  
    2222        do_action( 'bp_activity_screen_my_activity' );
    2323
    24         /**
    25          * Filters the template to load for the "My Activity" screen.
    26          *
    27          * @since 1.0.0
    28          *
    29          * @param string $template Path to the activity template to load.
    30          */
    31         bp_core_load_template( apply_filters( 'bp_activity_template_my_activity', 'members/single/home' ) );
     24        $templates = array(
     25                /**
     26                 * Filters the template to load for the "My Activity" screen.
     27                 *
     28                 * @since 1.0.0
     29                 *
     30                 * @param string $template Path to the activity template to load.
     31                 */
     32                apply_filters( 'bp_activity_template_my_activity', 'members/single/home' ),
     33                'members/single/index',
     34        );
     35
     36        bp_core_load_template( $templates );
    3237}
  • trunk/src/bp-activity/screens/mentions.php

    r11885 r13759  
    2323        do_action( 'bp_activity_screen_mentions' );
    2424
    25         /**
    26          * Filters the template to load for the "Mentions" screen.
    27          *
    28          * @since 1.2.0
    29          *
    30          * @param string $template Path to the activity template to load.
    31          */
    32         bp_core_load_template( apply_filters( 'bp_activity_template_mention_activity', 'members/single/home' ) );
     25        $templates = array(
     26                /**
     27                 * Filters the template to load for the "Mentions" screen.
     28                 *
     29                 * @since 1.2.0
     30                 *
     31                 * @param string $template Path to the activity template to load.
     32                 */
     33                apply_filters( 'bp_activity_template_mention_activity', 'members/single/home' ),
     34                'members/single/index',
     35        );
     36
     37        bp_core_load_template( $templates );
    3338}
    3439
     
    3843 * @since 1.5.0
    3944 *
     45 * @return void
    4046 */
    4147function bp_activity_reset_my_new_mentions() {
    42         if ( bp_is_my_profile() )
    43                 bp_activity_clear_new_mentions( bp_loggedin_user_id() );
     48        if ( ! bp_is_my_profile() ) {
     49                return;
     50        }
     51
     52        bp_activity_clear_new_mentions( bp_loggedin_user_id() );
    4453}
    4554add_action( 'bp_activity_screen_mentions', 'bp_activity_reset_my_new_mentions' );
  • trunk/src/bp-activity/screens/permalink.php

    r13714 r13759  
    9797 * @since 1.2.0
    9898 *
    99  * @return bool|string Boolean on false or the template for a single activity item on success.
     99 * @return void
    100100 */
    101101function bp_activity_screen_single_activity_permalink() {
    102102        // No displayed user or not viewing activity component.
    103103        if ( ! bp_is_activity_component() ) {
    104                 return false;
     104                return;
    105105        }
    106106
    107107        $action = bp_current_action();
    108108        if ( ! $action || ! is_numeric( $action ) ) {
    109                 return false;
     109                return;
    110110        }
    111111
    112112        // Get the activity details.
    113         $activity = bp_activity_get_specific( array(
    114                 'activity_ids' => $action,
    115                 'show_hidden'  => true,
    116                 'spam'         => 'ham_only',
    117         ) );
     113        $activity = bp_activity_get_specific(
     114                array(
     115                        'activity_ids' => $action,
     116                        'show_hidden'  => true,
     117                        'spam'         => 'ham_only',
     118                )
     119        );
    118120
    119121        // 404 if activity does not exist.
     
    162164        }
    163165
    164         /**
    165          * Filters the template to load for a single activity screen.
    166          *
    167          * @since 1.0.0
    168          *
    169          * @param string $template Path to the activity template to load.
    170          */
    171         $template = apply_filters( 'bp_activity_template_profile_activity_permalink', 'members/single/activity/permalink' );
     166        $templates = array(
     167                /**
     168                 * Filters the template to load for a single activity screen.
     169                 *
     170                 * @since 1.0.0
     171                 *
     172                 * @param string $template Path to the activity template to load.
     173                 */
     174                apply_filters( 'bp_activity_template_profile_activity_permalink', 'members/single/activity/permalink' ),
     175                'activity/single',
     176        );
    172177
    173         // Load the template.
    174         bp_core_load_template( $template );
     178        bp_core_load_template( $templates );
    175179}
    176180add_action( 'bp_screens', 'bp_activity_screen_single_activity_permalink' );
Note: See TracChangeset for help on using the changeset viewer.