Profile::ap_breadcrumbs( array $navs )

Description #

Hook into AnsPress breadcrums to show user profile page.

Parameters #

  • $navs
    array (Required) Breadcrumbs navs.

Source #

File: addons/profile/profile.php

	public function ap_breadcrumbs( $navs ) {
		if ( 'user' === ap_current_page() ) {
			$navs['page'] = array(
				'title' => ap_user_display_name( ap_current_user_id() ),
				'link'  => ap_user_link( ap_current_user_id() ),
				'order' => 8,
			);

			$current      = get_query_var( 'user_page', ap_opt( 'user_page_slug_questions' ) );
			$current_page = ap_search_array( anspress()->user_pages, 'rewrite', $current );
			if ( ! empty( $current_page ) ) {
				$navs['user'] = array(
					'title' => $current_page[0]['label'],
					'link'  => ap_user_link( ap_current_user_id() ) . $current . '/',
					'order' => 8,
				);
			}
		}

		return $navs;
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment