【发布时间】:2022-08-07 17:15:22
【问题描述】:
function dwqa_breadcrumb() {
$output = \'\';
if ( $term ) {
$output .= \'<span class=\"dwqa-sep\"> › </span>\';
if ( is_singular( \'dwqa-question\' ) ) {
$output .= \'<a href=\"\'. esc_url( get_term_link( $term, get_query_var( \'taxonomy\' ) ) ) .\'\">\' . $tax_name . \': \' . $term->name . \'</a>\';//displays category: and with name
} else {
$output .= \'<span class=\"dwqa-current\">\' . $tax_name . \': \' . $term->name . \'</span>\';//displays category: and with name
}
}
echo apply_filters( \'dwqa_breadcrumb\', $output );
endif;
}
add_action( \'dwqa_before_questions_archive\', \'dwqa_breadcrumb\' );
add_action( \'dwqa_before_single_question\', \'dwqa_breadcrumb\' );
上面的代码写在插件文件中。我想删除$tax_name通过functions.php而不编辑插件。我知道当它是一个数组时该怎么做,但我不能用变量来做。