【问题标题】:Modify WordPress plugin code from 'functions.php'从 \'functions.php\' 修改 WordPress 插件代码
【发布时间】:2022-08-07 17:15:22
【问题描述】:
function dwqa_breadcrumb() {
            $output = \'\';
            if ( $term ) {
            $output .= \'<span class=\"dwqa-sep\"> &rsaquo; </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而不编辑插件。我知道当它是一个数组时该怎么做,但我不能用变量来做。

    标签: php wordpress plugins


    【解决方案1】:

    您可以使用remove_action() 函数。

    Here 是有效的答案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-08
      • 1970-01-01
      • 1970-01-01
      • 2018-04-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-11
      相关资源
      最近更新 更多