Skip to:
Content

BuddyPress.org

Changeset 12570


Ignore:
Timestamp:
03/15/2020 06:15:19 AM (6 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

Location:
trunk/src/bp-templates/bp-nouveau
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/buddypress/members/members-loop.php

    r12082 r12570  
    44 *
    55 * @since 3.0.0
    6  * @version 3.0.0
     6 * @version 6.0.0
    77 */
    88
     
    3939                                                        <p class="item-meta last-activity">
    4040                                                                <?php bp_nouveau_member_meta(); ?>
    41                                                         </p><!-- #item-meta -->
     41                                                        </p><!-- .item-meta -->
    4242                                                <?php endif; ?>
     43
     44                                                <?php if ( bp_nouveau_member_has_extra_content() ) : ?>
     45                                                        <div class="item-extra-content">
     46                                                                <?php bp_nouveau_member_extra_content() ; ?>
     47                                                        </div><!-- .item-extra-content -->
     48                                                <?php endif ; ?>
    4349
    4450                                                <?php
     
    4955                                                        )
    5056                                                );
    51 ?>
    52 
     57                                                ?>
    5358                                        </div>
    5459
    5560                                        <?php if ( bp_get_member_latest_update() && ! bp_nouveau_loop_is_grid() ) : ?>
    56                                         <div class="user-update">
    57                                                 <p class="update"> <?php bp_member_latest_update(); ?></p>
    58                                         </div>
    59                                                 <?php endif; ?>
     61                                                <div class="user-update">
     62                                                        <p class="update"> <?php bp_member_latest_update(); ?></p>
     63                                                </div>
     64                                        <?php endif; ?>
    6065
    6166                                </div><!-- // .item -->
    62 
    63 
    64 
    6567                        </div>
    6668                </li>
  • trunk/src/bp-templates/bp-nouveau/common-styles/_bp_members_loop.scss

    r12082 r12570  
    11// BP Members loop.
    2 // @version 3.0.0
     2// @since 3.0.0
     3// @version 6.0.0
    34
    45.buddypress-wrap {
     
    1011                        .member-name {
    1112                                margin-bottom: $marg-sml;
     13                        }
     14
     15                        .item-extra-content {
     16                                clear: both;
     17
     18                                @include font-size(14);
    1219                        }
    1320
  • trunk/src/bp-templates/bp-nouveau/css/buddypress-rtl.css

    r12537 r12570  
    18731873.buddypress-wrap .members-list li .member-name {
    18741874        margin-bottom: 10px;
     1875}
     1876
     1877.buddypress-wrap .members-list li .item-extra-content {
     1878        clear: both;
     1879        font-size: 14px;
    18751880}
    18761881
  • trunk/src/bp-templates/bp-nouveau/css/buddypress.css

    r12537 r12570  
    18731873.buddypress-wrap .members-list li .member-name {
    18741874        margin-bottom: 10px;
     1875}
     1876
     1877.buddypress-wrap .members-list li .item-extra-content {
     1878        clear: both;
     1879        font-size: 14px;
    18751880}
    18761881
  • trunk/src/bp-templates/bp-nouveau/includes/members/functions.php

    r12156 r12570  
    44 *
    55 * @since 3.0.0
    6  * @version 3.1.0
     6 * @version 6.0.0
    77 */
    88
     
    160160 *
    161161 * @since 3.0.0
     162 * @since 6.0.0 Replace wrongly positioned `bp_directory_members_item`
     163 *              with `bp_directory_members_item_meta`
    162164 *
    163165 * @return string|false HTML Output if hooked. False otherwise.
     
    168170        if ( ! empty( $GLOBALS['members_template'] ) ) {
    169171                /**
    170                  * Fires inside the display of a directory member item.
     172                 * Fires inside the display of metas in the directory member item.
    171173                 *
    172                  * @since 1.1.0
     174                 * @since 6.0.0
    173175                 */
    174                 do_action( 'bp_directory_members_item' );
     176                do_action( 'bp_directory_members_item_meta' );
    175177
    176178        // It's the user's header
  • 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.