AnsPress_Breadcrumbs_Widget::get_breadcrumbs()

Description #

Get breadcrumbs array

Source #

File: widgets/breadcrumbs.php

	public static function get_breadcrumbs() {
		$current_page = ap_current_page();
		$title = ap_page_title();
		$a = array();

		$a['base'] = array( 'title' => ap_opt( 'base_page_title' ), 'link' => ap_base_page_link(), 'order' => 0 );

		if ( is_question() ) {
			$a['page'] = array( 'title' => $title, 'link' => get_permalink( get_question_id() ), 'order' => 10 );
		} elseif ( 'base' != $current_page && '' != $current_page ) {
			$a['page'] = array( 'title' => $title, 'link' => ap_get_link_to( $current_page ), 'order' => 10 );
		}

		$a = apply_filters( 'ap_breadcrumbs', $a );

		return ap_sort_array_by_order( $a );
	}

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Add your comment