在我的插件文件中,我试图将内容添加到编辑自定义帖子类型的自定义分类法的屏幕中。不幸的是,什么都没有出现。。。
<?
// A callback function to add a custom field to our taxonomy
function my_custom_fields() {
?>
<tr class="form-field">
<td>
hello
</td>
</tr>
<?
}
// Add the fields to the taxonomy, using our callback function
add_action( \'tha-seminar-category_edit_form_fields\', \'my_custom_fields\', 10, 2 );
?>
这是我注册分类法的方式:
register_taxonomy(\'tha-seminar-category\', \'tha_seminars\',
array("hierarchical" => true,
"label" => "Tha Seminar Categories",
\'update_count_callback\' => \'_update_post_term_count\',
\'query_var\' => true,
\'public\' => true,
\'show_ui\' => true,
\'show_admin_column\' => true,
\'show_tagcloud\' => true,
\'_builtin\' => false,
\'show_in_nav_menus\' => true,
\'show_in_rest\' => true,
\'show_in_quick_edit\' => true,
\'capabilities\' => array(
\'manage_terms\' => \'edit_tha_seminars\',
\'edit_terms\' => \'edit_tha_seminars\',
\'delete_terms\' => \'edit_tha_seminars\',
\'assign_terms\' => \'edit_tha_seminars\'
)
)
);
我希望在屏幕上看到“hello”
谢谢你的帮助!