bp_nouveau_get_member_meta()

Get the member meta.


Return Return

(array) The member meta.


Source Source

File: bp-templates/bp-nouveau/includes/members/template-tags.php

	function bp_nouveau_get_member_meta() {
		$meta    = array();
		$is_loop = false;

		if ( ! empty( $GLOBALS['members_template']->member ) ) {
			$member  = $GLOBALS['members_template']->member;
			$is_loop = true;
		} else {
			$member = bp_get_displayed_user();
		}

		if ( empty( $member->id ) ) {
			return $meta;
		}

		if ( empty( $member->template_meta ) ) {
			// It's a single user's header
			if ( ! $is_loop ) {
				$meta['last_activity'] = sprintf(
					'<span class="activity">%s</span>',
					esc_html( bp_get_last_activity( bp_displayed_user_id() ) )
				);

			// We're in the members loop
			} else {
				$meta = array(
					'last_activity' => sprintf( '%s', bp_get_member_last_active() ),
				);
			}

			// Make sure to include hooked meta.
			$extra_meta = bp_nouveau_get_hooked_member_meta();

			if ( $extra_meta ) {
				$meta['extra'] = $extra_meta;
			}

			/**
			 * Filter to add/remove Member meta.
			 *
			 * @since 3.0.0
			 *
			 * @param array  $meta    The list of meta to output.
			 * @param object $member  The member object
			 * @param bool   $is_loop True if in the members loop. False otherwise.
			 */
			$member->template_meta = apply_filters( 'bp_nouveau_get_member_meta', $meta, $member, $is_loop );
		}

		return $member->template_meta;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.