有一段时间也有同样的问题,我用一个过滤器来更改term\\u列表,以便在编辑时删除所有复选框。php页面。首先,您可以删除以下链接:
function remove_quick_edit( $actions ) {
unset($actions[\'inline hide-if-no-js\']);
return $actions;
}
add_filter(\'post_row_actions\',\'remove_quick_edit\',10,1);
这只会删除链接,但实际的类别选择器仍在源代码中。。。
add_filter(\'wp_terms_checklist_args\', \'remove_terms_from_list\', \'\', 2);
function remove_terms_from_list( $args, $post_id){
global $pagenow, $typenow;
if ($pagenow == \'edit.php\' && $typenow == \'post-type-name\' || $pagenow == \'nav-menus.php\') {
$args[\'walker\'] = new wiki_remove_tax_quickedit;
$args[\'taxonomy\'] = \' \';
}
return $args;
}
class wiki_remove_tax_quickedit extends Walker {
var $tree_type = \'category\';
var $db_fields = array (\'parent\' => \'parent\', \'id\' => \'term_id\');
function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat("\\t", $depth);
$output .= "$indent<ul class=\'children\'>\\n";
}
function end_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat("\\t", $depth);
$output .= "$indent</ul>\\n";
}
function start_el( &$output, $category, $depth, $args, $id = 0 ) {
}
}
(将帖子类型名称更改为您的帖子类型);