到目前为止,我已经尝试了很多事情,并对核心进行了彻底的调查,但找不到一种方法可以让我add the submenu item, 但是doesn\'t add the meta box 用于自定义分类法。
菜单项
// From: ~/wp-admin/menu.php
// That is the file that builds the menu and submenu entries.
// This is the part, where it adds the submenu items for taxonomies.
// This gets repeated for every (custom) post type menu entry.
$i = 15;
foreach ( get_taxonomies( array(), \'objects\' ) as $tax ) {
if ( ! $tax->show_ui || ! in_array(\'post\', (array) $tax->object_type, true) )
continue;
$submenu[\'edit.php\'][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, \'edit-tags.php?taxonomy=\' . $tax->name );
}
unset($tax);
元数据框
// From: ~/wp-admin/edit-form-advanced.php
// That is the file, that shows the content of a post type "edit" screen
// all taxonomies. Here it adds some meta boxes for taxonomies
foreach ( get_object_taxonomies($post_type) as $tax_name ) {
$taxonomy = get_taxonomy($tax_name);
if ( ! $taxonomy->show_ui )
continue;
$label = $taxonomy->labels->name;
if ( !is_taxonomy_hierarchical($tax_name) )
add_meta_box(\'tagsdiv-\' . $tax_name, $label, \'post_tags_meta_box\', null, \'side\', \'core\', array( \'taxonomy\' => $tax_name ));
else
add_meta_box($tax_name . \'div\', $label, \'post_categories_meta_box\', null, \'side\', \'core\', array( \'taxonomy\' => $tax_name ));
}
The
public
参数似乎只影响查询。我能看到的唯一的因素是,添加菜单项和元框,这两者都是由
show_ui
论点
请证明我错了。谢谢