store、store_categoryの部分を変更して使う感じです。
参考まで。
// タイトルの変更
function my_bcn_breadcrumb_title_filter( $title, $type, $id ) {
if ( in_array( 'taxonomy', $type ) ) {
$queried_object = get_queried_object();
if ( $queried_object && isset( $queried_object->post_type ) && $queried_object->post_type == 'store' ) {
$primary_category = get_post_meta( $queried_object->ID, '_yoast_wpseo_primary_store_category', true );
if ( $primary_category ) {
$term = get_term( $primary_category, 'store_category' );
if ( $term && ! is_wp_error( $term ) ) {
return $term->name;
}
}
}
}
return $title;
}
add_filter( 'bcn_breadcrumb_title', 'my_bcn_breadcrumb_title_filter', 10, 3 );
// URLの変更
function my_bcn_breadcrumb_url_filter( $url, $type, $id ) {
if ( in_array( 'taxonomy', $type ) ) {
$queried_object = get_queried_object();
if ( $queried_object && isset( $queried_object->post_type ) && $queried_object->post_type == 'store' ) {
$primary_category = get_post_meta( $queried_object->ID, '_yoast_wpseo_primary_store_category', true );
if ( $primary_category ) {
$term = get_term( $primary_category, 'store_category' );
if ( $term && ! is_wp_error( $term ) ) {
return get_term_link( $term );
}
}
}
}
return $url;
}
add_filter( 'bcn_breadcrumb_url', 'my_bcn_breadcrumb_url_filter', 10, 3 );