WordPress自定义文章编辑页面的分类和标签Meta模块标题
WordPress自定义文章编辑页面的分类和标签Meta模块标题的方法。
将下面的代码添加到主题的 functions.php 文件中:
add_action( 'add_meta_boxes', 'change_cat_meta_box', 0 );
function change_cat_meta_box() {
global $wp_meta_boxes;
unset( $wp_meta_boxes['post']['side']['core']['categorydiv'] );
add_meta_box('categorydiv',
__('自定义分类模块标题'),
'post_categories_meta_box',
'post',
'side',
'low');
}
add_action( 'add_meta_boxes', 'change_tag_meta_box', 0 );
function change_tag_meta_box() {
global $wp_meta_boxes;
unset( $wp_meta_boxes['post']['side']['core']['tagsdiv-post_tag'] );
add_meta_box('tagsdiv-post_tag',
__('自定义标签模块标题'),
'post_tags_meta_box',
'post',
'side',
'low');
}
最终的结果如下图所示:
来自:https://www.wpdaxue.com/custom-title-of-category-and-tag-meta-boxes.html
