Created
February 10, 2014 16:40
-
-
Save chssweb/8919411 to your computer and use it in GitHub Desktop.
Some experiements with Breadcrumb NavXT actions and hooks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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