首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >{$taxonomy}_edit_form_fields不工作

{$taxonomy}_edit_form_fields不工作
EN

WordPress Development用户
提问于 2019-08-22 11:48:22
回答 1查看 768关注 0票数 0

在我的插件文件中,我试图将内容添加到编辑自定义post类型的自定义分类的屏幕上。不幸的是什么都没有出现..。

代码语言:javascript
复制
<?
// 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 );  
?>

我就是这样注册分类法的:

代码语言:javascript
复制
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'
    )
)
);

我希望在屏幕上看到“你好”

谢谢你帮忙!

EN

回答 1

WordPress Development用户

回答已采纳

发布于 2019-08-22 13:39:15

使用tha-seminar-category_add_form_fields操作在新类别页面上显示。tha-seminar-category_edit_form_fields用于类别的编辑页面。

票数 2
EN
页面原文内容由WordPress Development提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://wordpress.stackexchange.com/questions/345658

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档