Tags::ap_breadcrumbs( array $navs )
Description #
Hook into AnsPress breadcrums to show tags page.
Parameters #
- $navsarray (Required) Breadcrumbs navs.
Source #
File: addons/tags/tags.php
public function ap_breadcrumbs( $navs ) {
if ( is_question_tag() ) {
$tag_id = sanitize_title( get_query_var( 'q_tag' ) );
$tag = $tag_id ? get_term_by( 'slug', $tag_id, 'question_tag' ) : get_queried_object();
$navs['page'] = array(
'title' => __( 'Tags', 'anspress-question-answer' ),
'link' => ap_get_link_to( 'tags' ),
'order' => 8,
);
if ( $tag ) {
$navs['tag'] = array(
'title' => $tag->name,
'link' => get_term_link( $tag, 'question_tag' ), // @codingStandardsIgnoreLine.
'order' => 8,
);
}
} elseif ( is_question_tags() ) {
$navs['page'] = array(
'title' => __( 'Tags', 'anspress-question-answer' ),
'link' => ap_get_link_to( 'tags' ),
'order' => 8,
);
}
return $navs;
}
Expand full source code Collapse full source code View on GitHub: addons/tags/tags.php:471
Add your comment