BP_Members_Component::get_avatar_cover_image_subnavs()

Get the Avatar and Cover image subnavs.


Return Return

(array) The Avatar and Cover image subnavs.


Source Source

File: bp-members/classes/class-bp-members-component.php

	public function get_avatar_cover_image_subnavs() {
		$subnavs = array();

		$access       = bp_core_can_edit_settings();
		$slug         = bp_get_profile_slug();
		$profile_link = bp_get_members_component_link( buddypress()->profile->id );

		// Change Avatar.
		if ( buddypress()->avatar->show_avatars ) {
			$subnavs[] = array(
				'name'            => _x( 'Change Profile Photo', 'Profile header sub menu', 'buddypress' ),
				'slug'            => 'change-avatar',
				'parent_url'      => $profile_link,
				'parent_slug'     => $slug,
				'screen_function' => 'bp_members_screen_change_avatar',
				'position'        => 30,
				'user_has_access' => $access
			);
		}

		// Change Cover image.
		if ( bp_displayed_user_use_cover_image_header() ) {
			$subnavs[] = array(
				'name'            => _x( 'Change Cover Image', 'Profile header sub menu', 'buddypress' ),
				'slug'            => 'change-cover-image',
				'parent_url'      => $profile_link,
				'parent_slug'     => $slug,
				'screen_function' => 'bp_members_screen_change_cover_image',
				'position'        => 40,
				'user_has_access' => $access
			);
		}

		return $subnavs;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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