Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/15/2020 06:15:19 AM (4 years ago)
Author:
imath
Message:

BP Nouveau: improve bp_directory_members_item hook positioning

In 3.0.0, we wrongly positioned this hook into the Members loop's item meta. We are repositioning it at a more consistent place considering BP Legacy, which is outside of the p.item-meta tag.

Fixes #8183

File:
1 edited

Legend:

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

    r12567 r12570  
    590590
    591591/**
     592 * Check if some extra content needs to be displayed into the members directory.
     593 *
     594 * @since 6.0.0
     595 *
     596 * @return bool True if some extra content needs to be displayed into the members directory.
     597 *              False otherwise.
     598 */
     599function bp_nouveau_member_has_extra_content() {
     600    /**
     601     * Filter here to display the extra content not only into the Members directory.
     602     *
     603     * @since 6.0.0
     604     *
     605     * @param bool $value True if on the Members directory page.
     606     *                    False otherwise.
     607     */
     608    $members_directory_only = (bool) apply_filters( 'bp_nouveau_member_extra_content_in_members_directory', bp_is_members_directory() );
     609
     610    // Check if some extra content needs to be included into the item of the loop.
     611    $has_action = (bool) has_action( 'bp_directory_members_item' );
     612
     613    return $members_directory_only && $has_action;
     614}
     615
     616/**
     617 * Displays extra content for each item of a members loop.
     618 *
     619 * @since 6.0.0
     620 */
     621function bp_nouveau_member_extra_content() {
     622    /**
     623     * Fires inside the display of a members loop member item.
     624     *
     625     * @since 1.1.0
     626     */
     627    do_action( 'bp_directory_members_item' );
     628}
     629
     630/**
    592631 * Load the appropriate content for the single member pages
    593632 *
Note: See TracChangeset for help on using the changeset viewer.