Skip to:
Content

BuddyPress.org


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.