Skip to:
Content

BuddyPress.org

Changeset 12799


Ignore:
Timestamp:
11/19/2020 10:58:06 PM (2 months ago)
Author:
imath
Message:

Member Types: improve the newly introduced bp_member_type_list()

This is a followup to [12797] in order to make it possible to avoid showing the template tag's label.

See #8394

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-template.php

    r12797 r12799  
    21232123        );
    21242124
     2125        // Should the label be output?
     2126        $has_label = ! empty( $r['label'] );
     2127
    21252128        $labels = wp_parse_args(
    21262129            $r['label'],
     
    21432146            }
    21442147
    2145             $before = $after = '';
    2146             $count = count( $types );
     2148            $before = $after = $label = '';
     2149            $count  = count( $types );
    21472150
    21482151            if ( 1 === $count ) {
     
    21562159                $parent_elem = new BP_Core_HTML_Element( array(
    21572160                    'element' => $r['parent_element'],
    2158                     'attr'    => $r['parent_attr']
     2161                    'attr'    => $r['parent_attr'],
    21592162                ) );
    21602163
     
    21692172                    'element'    => $r['label_element'],
    21702173                    'attr'       => $r['label_attr'],
    2171                     'inner_html' => esc_html( $label_text )
     2174                    'inner_html' => esc_html( $label_text ),
    21722175                ) );
    21732176                $label = $label->contents() . ' ';
    21742177
    21752178            // No element, just the label.
    2176             } else {
     2179            } elseif ( $has_label ) {
    21772180                $label = esc_html( $label_text );
    21782181            }
  • trunk/src/bp-templates/bp-nouveau/buddypress/members/single/cover-image-header.php

    r12797 r12799  
    44 *
    55 * @since 3.0.0
    6  * @version 3.0.0
     6 * @version 7.0.0
    77 */
    88?>
  • trunk/src/bp-templates/bp-nouveau/buddypress/members/single/member-header.php

    r12797 r12799  
    44 *
    55 * @since 3.0.0
    6  * @version 3.0.0
     6 * @version 7.0.0
    77 */
    88?>
Note: See TracChangeset for help on using the changeset viewer.