<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][12797] trunk/src: Introduce a new template tag to list a user's member types</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://buddypress.trac.wordpress.org/changeset/12797">12797</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/12797","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>imath</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2020-11-19 21:21:19 +0000 (Thu, 19 Nov 2020)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Introduce a new template tag to list a user's member types
Just like Group Types can be listed into the displayed Group's header thanks to a specific template tag, Member types now have their own template tag `bp_member_type_list()` to do the same into the displayed user's header.
BP Nouveau is using this tag. Its header templates and styles has been updated to optimize the output of this list.
By default Member Types will not be displayed, their corresponding object will need to have their `show_in_list` property set to `true`.
Fixes <a href="http://buddypress.trac.wordpress.org/ticket/8394">#8394</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbpcorebpcorefunctionsphp">trunk/src/bp-core/bp-core-functions.php</a></li>
<li><a href="#trunksrcbpmembersbpmembersfunctionsphp">trunk/src/bp-members/bp-members-functions.php</a></li>
<li><a href="#trunksrcbpmembersbpmemberstemplatephp">trunk/src/bp-members/bp-members-template.php</a></li>
<li><a href="#trunksrcbptemplatesbpnouveaubuddypressmemberssinglecoverimageheaderphp">trunk/src/bp-templates/bp-nouveau/buddypress/members/single/cover-image-header.php</a></li>
<li><a href="#trunksrcbptemplatesbpnouveaubuddypressmemberssinglememberheaderphp">trunk/src/bp-templates/bp-nouveau/buddypress/members/single/member-header.php</a></li>
<li><a href="#trunksrcbptemplatesbpnouveaucommonstyles_bp_user_headerscss">trunk/src/bp-templates/bp-nouveau/common-styles/_bp_user_header.scss</a></li>
<li><a href="#trunksrcbptemplatesbpnouveaucssbuddypressrtlcss">trunk/src/bp-templates/bp-nouveau/css/buddypress-rtl.css</a></li>
<li><a href="#trunksrcbptemplatesbpnouveaucssbuddypresscss">trunk/src/bp-templates/bp-nouveau/css/buddypress.css</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpcorebpcorefunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/bp-core-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-functions.php 2020-11-19 18:18:54 UTC (rev 12796)
+++ trunk/src/bp-core/bp-core-functions.php 2020-11-19 21:21:19 UTC (rev 12797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3232,6 +3232,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $db_types[ $type_name ]->{$type_key} = get_term_meta( $term->term_id, $meta_key, true );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( ! empty( $db_types[ $type_name ]->has_directory ) && empty( $db_types[ $type_name ]->directory_slug ) ) {
+ $db_types[ $type_name ]->directory_slug = $term->slug;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbpmembersbpmembersfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-members/bp-members-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-members/bp-members-functions.php 2020-11-19 18:18:54 UTC (rev 12796)
+++ trunk/src/bp-members/bp-members-functions.php 2020-11-19 21:21:19 UTC (rev 12797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2718,6 +2718,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Specific to BuddyPress.
</span><span class="cx" style="display: block; padding: 0 10px"> 'bp_type_id_label' => _x( 'Member Type ID', 'BP Member type ID label', 'buddypress' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'bp_type_id_description' => _x( 'Enter a lower-case string without spaces or special characters (used internally to identify the member type).', 'BP Member type ID description', 'buddypress' ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'bp_type_show_in_list' => _x( 'Show on Member', 'BP Member type show in list', 'buddypress' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2762,15 +2763,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function bp_get_member_type_metadata_schema( $schema = array(), $taxonomy = '' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( bp_get_member_type_tax_name() === $taxonomy ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Directory
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Directory.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $schema['bp_type_has_directory']['description'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $schema['bp_type_has_directory']['description'] = __( 'Make a list of members matching this type available on the members directory.', 'buddypress' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Slug
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Slug.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $schema['bp_type_directory_slug']['description'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $schema['bp_type_directory_slug']['description'] = __( 'Enter if you want the type slug to be different from its ID.', 'buddypress' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ // List.
+ $schema['bp_type_show_in_list'] = array(
+ 'description' => __( 'Show where member types may be listed, like in the member header.', 'buddypress' ),
+ 'type' => 'boolean',
+ 'single' => true,
+ 'sanitize_callback' => 'absint',
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $schema;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2810,6 +2819,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Pass `true` to use the `$member_type` string as the type's slug.
</span><span class="cx" style="display: block; padding: 0 10px"> * Pass a string to customize the slug. Pass `false` to disable.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default: true.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @type bool $show_in_list Whether this member type should be shown in lists rendered by
+ * bp_member_type_list(). Default: false.
+ * @type bool $code Whether this member type is registered using code. Default: true.
+ * @type int $db_id The member type term ID. Default: 0.
</ins><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> * @return object|WP_Error Member type object on success, WP_Error object on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2823,6 +2836,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $r = bp_parse_args( $args, array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'labels' => array(),
</span><span class="cx" style="display: block; padding: 0 10px"> 'has_directory' => true,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'show_in_list' => false,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'code' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'db_id' => 0,
</span><span class="cx" style="display: block; padding: 0 10px"> ), 'register_member_type' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2872,6 +2886,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $r['has_directory'] = false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Show the list of member types on front-end (member header, for now).
+ $r['show_in_list'] = (bool) $r['show_in_list'];
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $bp->members->types[ $member_type ] = $type = (object) $r;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcbpmembersbpmemberstemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-members/bp-members-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-members/bp-members-template.php 2020-11-19 18:18:54 UTC (rev 12796)
+++ trunk/src/bp-members/bp-members-template.php 2020-11-19 21:21:19 UTC (rev 12797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1692,7 +1692,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $last_activity = bp_core_get_last_activity( bp_get_user_last_activity( $user_id ), __('Active %s', 'buddypress') );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $last_activity = bp_core_get_last_activity( bp_get_user_last_activity( $user_id ), __( 'Active %s', 'buddypress') );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the 'active [x days ago]' string for a user.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2020,6 +2020,187 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'bp_get_current_member_type_message', $message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Output member type directory link.
+ *
+ * @since 7.0.0
+ *
+ * @param string $member_type Unique member type identifier as used in bp_register_member_type().
+ */
+function bp_member_type_directory_link( $member_type = '' ) {
+ echo bp_get_member_type_directory_link( $member_type );
+}
+ /**
+ * Return member type directory link.
+ *
+ * @since 7.0.0
+ *
+ * @param string $member_type Unique member type identifier as used in bp_register_member_type().
+ * @return string
+ */
+ function bp_get_member_type_directory_link( $member_type = '' ) {
+ if ( empty( $member_type ) ) {
+ return '';
+ }
+
+ $member_type_object = bp_get_member_type_object( $member_type );
+
+ if ( ! isset( $member_type_object->labels['name'] ) ) {
+ return '';
+ }
+
+ $member_type_text = $member_type_object->labels['name'];
+ if ( isset( $member_type_object->labels['singular_name'] ) && $member_type_object->labels['singular_name'] ) {
+ $member_type_text = $member_type_object->labels['singular_name'];
+ }
+
+ if ( empty( $member_type_object->has_directory ) ) {
+ return esc_html( $member_type_text );
+ }
+
+ return sprintf(
+ '<a href="%1$s">%2$s</a>',
+ esc_url( bp_get_member_type_directory_permalink( $member_type ) ),
+ esc_html( $member_type_text )
+ );
+ }
+
+/**
+ * Output a comma-delimited list of member types.
+ *
+ * @since 7.0.0
+ * @see bp_get_member_type_list() For additional information on default arguments.
+ *
+ * @param int $user_id User ID.
+ * @param array $r Optional. Member type list arguments. Default empty array.
+ */
+function bp_member_type_list( $user_id = 0, $r = array() ) {
+ echo bp_get_member_type_list( $user_id, $r );
+}
+ /**
+ * Return a comma-delimited list of member types.
+ *
+ * @since 7.0.0
+ *
+ * @param int $user_id User ID. Defaults to displayed user ID if on a member page.
+ * @param array|string $r {
+ * Array of parameters. All items are optional.
+ * @type string $parent_element Element to wrap around the list. Defaults to 'p'.
+ * @type array $parent_attr Element attributes for parent element. Defaults to
+ * array( 'class' => 'bp-member-type-list' ).
+ * @type array $label Plural and singular labels to use before the list. Defaults to
+ * array( 'plural' => 'Member Types:', 'singular' => 'Member Type:' ).
+ * @type string $label_element Element to wrap around the label. Defaults to 'strong'.
+ * @type array $label_attr Element attributes for label element. Defaults to array().
+ * @type bool $show_all Whether to show all registered group types. Defaults to 'false'. If
+ * 'false', only shows member types with the 'show_in_list' parameter set to
+ * true. See bp_register_member_type() for more info.
+ * @type string $list_element Element to wrap around the comma separated list of membet types. Defaults to ''.
+ * @type string $list_element_attr Element attributes for list element. Defaults to array().
+ * }
+ * @return string
+ */
+ function bp_get_member_type_list( $user_id = 0, $r = array() ) {
+ if ( empty( $user_id ) ) {
+ $user_id = bp_displayed_user_id();
+ }
+
+ $r = bp_parse_args(
+ $r,
+ array(
+ 'parent_element' => 'p',
+ 'parent_attr' => array(
+ 'class' => 'bp-member-type-list',
+ ),
+ 'label' => array(),
+ 'label_element' => 'strong',
+ 'label_attr' => array(),
+ 'show_all' => false,
+ 'list_element' => '',
+ 'list_element_attr' => array(),
+ ),
+ 'member_type_list'
+ );
+
+ $labels = wp_parse_args(
+ $r['label'],
+ array(
+ 'plural' => __( 'Member Types:', 'buddypress' ),
+ 'singular' => __( 'Member Type:', 'buddypress' ),
+ )
+ );
+
+ $retval = '';
+ $types = bp_get_member_type( $user_id, false );
+
+ if ( $types ) {
+ // Make sure we can show the type in the list.
+ if ( false === $r['show_all'] ) {
+ $types = array_intersect( bp_get_member_types( array( 'show_in_list' => true ) ), $types );
+ if ( empty( $types ) ) {
+ return $retval;
+ }
+ }
+
+ $before = $after = '';
+ $count = count( $types );
+
+ if ( 1 === $count ) {
+ $label_text = $labels['singular'];
+ } else {
+ $label_text = $labels['plural'];
+ }
+
+ // Render parent element.
+ if ( ! empty( $r['parent_element'] ) ) {
+ $parent_elem = new BP_Core_HTML_Element( array(
+ 'element' => $r['parent_element'],
+ 'attr' => $r['parent_attr']
+ ) );
+
+ // Set before and after.
+ $before = $parent_elem->get( 'open_tag' );
+ $after = $parent_elem->get( 'close_tag' );
+ }
+
+ // Render label element.
+ if ( ! empty( $r['label_element'] ) ) {
+ $label = new BP_Core_HTML_Element( array(
+ 'element' => $r['label_element'],
+ 'attr' => $r['label_attr'],
+ 'inner_html' => esc_html( $label_text )
+ ) );
+ $label = $label->contents() . ' ';
+
+ // No element, just the label.
+ } else {
+ $label = esc_html( $label_text );
+ }
+
+ // The list of types.
+ $list = implode( ', ', array_map( 'bp_get_member_type_directory_link', $types ) );
+
+ // Render the list of types element.
+ if ( ! empty( $r['list_element'] ) ) {
+ $list_element = new BP_Core_HTML_Element( array(
+ 'element' => $r['list_element'],
+ 'attr' => $r['list_element_attr'],
+ 'inner_html' => $list,
+ ) );
+
+ $list = $list_element->contents();
+ }
+
+ // Comma-delimit each type into the group type directory link.
+ $label .= $list;
+
+ // Retval time!
+ $retval = $before . $label . $after;
+ }
+
+ return $retval;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /** Signup Form ***************************************************************/
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcbptemplatesbpnouveaubuddypressmemberssinglecoverimageheaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-templates/bp-nouveau/buddypress/members/single/cover-image-header.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-templates/bp-nouveau/buddypress/members/single/cover-image-header.php 2020-11-19 18:18:54 UTC (rev 12796)
+++ trunk/src/bp-templates/bp-nouveau/buddypress/members/single/cover-image-header.php 2020-11-19 21:21:19 UTC (rev 12797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'container_classes' => array( 'member-header-actions' ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php bp_nouveau_member_hook( 'before', 'header_meta' ); ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,6 +45,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </div><!-- #item-meta -->
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endif; ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ bp_member_type_list(
+ bp_displayed_user_id(),
+ array(
+ 'label' => array(
+ 'plural' => __( 'Member Types', 'buddypress' ),
+ 'singular' => __( 'Member Type', 'buddypress' ),
+ ),
+ 'list_element' => 'span',
+ )
+ );
+ ?>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> </div><!-- #item-header-content -->
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> </div><!-- #item-header-cover-image -->
</span></span></pre></div>
<a id="trunksrcbptemplatesbpnouveaubuddypressmemberssinglememberheaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-templates/bp-nouveau/buddypress/members/single/member-header.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-templates/bp-nouveau/buddypress/members/single/member-header.php 2020-11-19 18:18:54 UTC (rev 12796)
+++ trunk/src/bp-templates/bp-nouveau/buddypress/members/single/member-header.php 2020-11-19 21:21:19 UTC (rev 12797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,5 +31,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </div><!-- #item-meta -->
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endif; ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ bp_member_type_list(
+ bp_displayed_user_id(),
+ array(
+ 'label' => array(
+ 'plural' => __( 'Member Types', 'buddypress' ),
+ 'singular' => __( 'Member Type', 'buddypress' ),
+ ),
+ 'list_element' => 'span',
+ )
+ );
+ ?>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php bp_nouveau_member_header_buttons( array( 'container_classes' => array( 'member-header-actions' ) ) ); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </div><!-- #item-header-content -->
</span></span></pre></div>
<a id="trunksrcbptemplatesbpnouveaucommonstyles_bp_user_headerscss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-templates/bp-nouveau/common-styles/_bp_user_header.scss</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-templates/bp-nouveau/common-styles/_bp_user_header.scss 2020-11-19 18:18:54 UTC (rev 12796)
+++ trunk/src/bp-templates/bp-nouveau/common-styles/_bp_user_header.scss 2020-11-19 21:21:19 UTC (rev 12797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,20 +1,40 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // BP Single User Specific Header Styles
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-// @version 3.0.0
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// @since 3.0.0
+// @version 7.0.0
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.bp-user {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+body.buddypress.bp-user {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- .users-header {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .buddypress-wrap {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- .user-nicename {
- margin-bottom: $marg-xsml;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .users-header {
+
+ h2.user-nicename {
+ margin-top: 0;
+ margin-bottom: $marg-xsml;
+ }
+
+ .bp-member-type-list {
+ padding-bottom: 0.5em;
+
+ @include font-size(18);
+ margin: 0;
+ color: $black;
+ display: flex;
+
+ strong {
+ padding-right: $pad-med;
+ white-space: nowrap;
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- .member-header-actions {
- overflow: hidden;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .member-header-actions {
+ overflow: hidden;
+ padding-left: 0;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * > * {
- display: block;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * > * {
+ display: block;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcbptemplatesbpnouveaucssbuddypressrtlcss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-templates/bp-nouveau/css/buddypress-rtl.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-templates/bp-nouveau/css/buddypress-rtl.css 2020-11-19 18:18:54 UTC (rev 12796)
+++ trunk/src/bp-templates/bp-nouveau/css/buddypress-rtl.css 2020-11-19 21:21:19 UTC (rev 12797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2404,15 +2404,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * User Accounts Specific Item Header
</span><span class="cx" style="display: block; padding: 0 10px"> *-----------------------------------------------------
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.bp-user .users-header .user-nicename {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+body.buddypress.bp-user .buddypress-wrap .users-header h2.user-nicename {
+ margin-top: 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> margin-bottom: 5px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.bp-user .member-header-actions {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+body.buddypress.bp-user .buddypress-wrap .users-header .bp-member-type-list {
+ padding-bottom: 0.5em;
+ font-size: 18px;
+ margin: 0;
+ color: #333;
+ display: flex;
+}
+
+body.buddypress.bp-user .buddypress-wrap .users-header .bp-member-type-list strong {
+ padding-left: 1em;
+ white-space: nowrap;
+}
+
+body.buddypress.bp-user .buddypress-wrap .member-header-actions {
</ins><span class="cx" style="display: block; padding: 0 10px"> overflow: hidden;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ padding-right: 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.bp-user .member-header-actions * > * {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+body.buddypress.bp-user .buddypress-wrap .member-header-actions * > * {
</ins><span class="cx" style="display: block; padding: 0 10px"> display: block;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbptemplatesbpnouveaucssbuddypresscss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-templates/bp-nouveau/css/buddypress.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-templates/bp-nouveau/css/buddypress.css 2020-11-19 18:18:54 UTC (rev 12796)
+++ trunk/src/bp-templates/bp-nouveau/css/buddypress.css 2020-11-19 21:21:19 UTC (rev 12797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2404,15 +2404,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * User Accounts Specific Item Header
</span><span class="cx" style="display: block; padding: 0 10px"> *-----------------------------------------------------
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.bp-user .users-header .user-nicename {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+body.buddypress.bp-user .buddypress-wrap .users-header h2.user-nicename {
+ margin-top: 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> margin-bottom: 5px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.bp-user .member-header-actions {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+body.buddypress.bp-user .buddypress-wrap .users-header .bp-member-type-list {
+ padding-bottom: 0.5em;
+ font-size: 18px;
+ margin: 0;
+ color: #333;
+ display: flex;
+}
+
+body.buddypress.bp-user .buddypress-wrap .users-header .bp-member-type-list strong {
+ padding-right: 1em;
+ white-space: nowrap;
+}
+
+body.buddypress.bp-user .buddypress-wrap .member-header-actions {
</ins><span class="cx" style="display: block; padding: 0 10px"> overflow: hidden;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ padding-left: 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.bp-user .member-header-actions * > * {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+body.buddypress.bp-user .buddypress-wrap .member-header-actions * > * {
</ins><span class="cx" style="display: block; padding: 0 10px"> display: block;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre>
</div>
</div>
</body>
</html>