{$taxonomy}_edit_form_fields not working

In my plugin file, I'm trying to add content to the screen where custom taxonomy of custom post type is edited. Unf

In my plugin file, I'm trying to add content to the screen where custom taxonomy of custom post type is edited. Unfortunatelly nothing appears...

<?
// 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 );  
?>

This is how I register the taxonomy:

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'
    )
)
);

The screen I expect to see "hello" at

Thanks for help!

In my plugin file, I'm trying to add content to the screen where custom taxonomy of custom post type is edited. Unfortunatelly nothing appears...

<?
// 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 );  
?>

This is how I register the taxonomy:

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'
    )
)
);

The screen I expect to see "hello" at

Thanks for help!

Share Improve this question asked Aug 22, 2019 at 11:48 FankyFanky 3171 silver badge12 bronze badges 1
  • Your screenshot is of the new term form. If you click to edit a term do you see your field? – Jacob Peattie Commented Aug 22, 2019 at 12:54
Add a comment  | 

1 Answer 1

Reset to default 2

Use tha-seminar-category_add_form_fieldsaction to show on new category page. tha-seminar-category_edit_form_fields is for the edit page of the category

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745226696a4617493.html

相关推荐

  • {$taxonomy}_edit_form_fields not working

    In my plugin file, I'm trying to add content to the screen where custom taxonomy of custom post type is edited. Unf

    5小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信