Skip to content

Instantly share code, notes, and snippets.

@chssweb
Created February 10, 2014 16:40
Show Gist options
  • Save chssweb/8919411 to your computer and use it in GitHub Desktop.
Save chssweb/8919411 to your computer and use it in GitHub Desktop.
Some experiements with Breadcrumb NavXT actions and hooks
<?php
/* Move Keyword trail to research level */
//add_action('bcn_after_fill','fix_keyword_breadcrumb');
function fix_keyword_breadcrumb($trail) {
if (is_tax( 'cp_keywords')){
// print_r($trail->breadcrumbs->title);
// unset($trail->trail[1]);
// $trail->trail = array_values($trail->trail);
return $trail;
}
}
?>
<?php
add_filter('bcn_breadcrumb_title','cp_bcn', 10,3);
function cp_bcn($title) {
if (is_tax( 'keywords')){
return $title . '_keywords';
} else {
return $title;
}
}
add_action( 'bcn_before_fill', 'nass_breadcrumb_do_bp' );
function nass_breadcrumb_do_bp( $bcn_trail ) {
if (is_tax( 'keywords')){ // not doing a buddypress thang, so go home
// print_r($bcn_trail);
$breadcrumb = $bcn_trail->add( new bcn_breadcrumb( 'Put me at the end', '', ''));
return $breadcrumb;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment