admin管理员组文章数量:1125550
I'm using the following code to create a custom metabox on a custom taxonomy page.
$term_filter_name_edit = $type . '_edit_form_fields';
add_action($term_filter_name_edit, 'box_term', 1000, 1 );
function box_term() {
echo 'Test output';
}
However, this outputs Test output
before the default term fields. I want it to output after the default term fields.
How can I achieve this?
--
Curiously, using _add_form_fields
outputs after the fields on the add page, but using _edit_form_fields
seems to output before.
I'm using the following code to create a custom metabox on a custom taxonomy page.
$term_filter_name_edit = $type . '_edit_form_fields';
add_action($term_filter_name_edit, 'box_term', 1000, 1 );
function box_term() {
echo 'Test output';
}
However, this outputs Test output
before the default term fields. I want it to output after the default term fields.
How can I achieve this?
--
Curiously, using _add_form_fields
outputs after the fields on the add page, but using _edit_form_fields
seems to output before.
- Even more curiously, the documentation seems to suggest that it should output after the form fields. Perhaps I'm doing something wrong, but I can't see quite what that might be. developer.wordpress.org/reference/hooks/… – Kevin Robinson Commented May 22, 2018 at 17:00
1 Answer
Reset to default 1Got it!
It seems this action is fired within a table element.
Removing the _fields
part seems to have done the trick as this refers to an action fired later in the page, after the table.
$term_filter_name_edit = $type . '_edit_form';
add_action($term_filter_name_edit, 'box_term', 1000, 1 );
function box_term() {
echo 'Test output';
}
Reference: https://github.com/WordPress/WordPress/blob/master/wp-admin/edit-tag-form.php
本文标签: taxonomytaxonomyeditformfields output after term fields
版权声明:本文标题:taxonomy - taxonomy_edit_form_fields output after term fields 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736641754a1946011.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论