Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/27/2023 10:55:27 PM (2 years ago)
Author:
imath
Message:

Introduce a new Theme Compat feature firstly designed for Block Themes

NB : this feature is also only available in the BP Nouveau template pack.

The Priority Navigations theme compat feature is used to make sure BP Single items primary and secondary navigations are displayed on a single row/line no matter how many items these navigations are containing.
When there's not enough space to display all the items on this row/line, an ellipsis is inserted and hovering on it shows the remaining nav items into a dropdown menu.

This commit also make sure the BP Customizer sections are neutralized so that the Customizer is not loaded on front-end when a Block Theme is active to start complying with the fact these kind of themes are not using the Customizer.

See #9030
See https://github.com/buddypress/buddypress/pull/197

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/includes/members/template-tags.php

    r13504 r13652  
    10211021    <?php
    10221022}
     1023
     1024/**
     1025 * Customize the way to output the Members' loop member latest activities.
     1026 *
     1027 * @since 12.0.0
     1028 *
     1029 * @param string $activity_content Formatted latest update for current member.
     1030 * @param array  $args             Array of parsed arguments.
     1031 * @param array  $latest_update    Array of the latest activity data.
     1032 * @return string The formatted latest update for current member.
     1033 */
     1034function bp_nouveau_get_member_latest_update( $activity_content = '', $args = array(), $latest_update = array() ) {
     1035    if ( ! isset( $latest_update['content'], $latest_update['excerpt'], $latest_update['permalink'] ) ) {
     1036        return $activity_content;
     1037    }
     1038
     1039    if ( strlen( $latest_update['excerpt'] ) < strlen( $latest_update['content'] ) ) {
     1040        return sprintf(
     1041            '%1$s<span class="activity-read-more"><a href="%2$s" rel="nofollow">%3$s</a></span>',
     1042            esc_html( $latest_update['excerpt'] ) . "\n",
     1043            esc_url( $latest_update['permalink'] ),
     1044            esc_html__( 'View full conversation', 'buddypress' )
     1045        );
     1046    }
     1047
     1048    return esc_html( $latest_update['excerpt'] );
     1049}
     1050add_filter( 'bp_get_member_latest_update', 'bp_nouveau_get_member_latest_update', 10, 3 );
Note: See TracChangeset for help on using the changeset viewer.