admin管理员组文章数量:1122832
I have a custom post type (FAQs), taxonomy (FAQ Categories) and everytime I want to create one it appears all the same name, slug, parent, description fields. I was wondering... If there is a possibility I could override, for example, the 'Name' input bottom label?
I have a custom post type (FAQs), taxonomy (FAQ Categories) and everytime I want to create one it appears all the same name, slug, parent, description fields. I was wondering... If there is a possibility I could override, for example, the 'Name' input bottom label?
Share Improve this question asked Aug 23, 2024 at 15:35 neke90neke90 11 bronze badge 1- After building countless custom plugin functions to manage taxonomy meta, I've found ACF plugin to be so much easier. Not selling anything here, just saying sometimes it's worth paying for a good premium plugin and ACF is excellent. You can edit custom meta details for each taxonomy and also customize the main "name" field using filters. – Simon Commented Aug 26, 2024 at 5:56
1 Answer
Reset to default 0There's a filter for taxonomy labels, taxonomy_labels_{$taxonomy}
(the {$taxonomy}
should be replaced with your custom taxonomy name) that allows you to filter pretty much all of it.
Example:
// Assuming your custom taxonomy is named 'faq_category'. Adjust as needed.
add_filter( 'taxonomy_labels_faq_category', 'wpse626542_taxonomy_labels' );
/**
* Filters the taxonomy labels.
*
* @param object $labels The taxonomy labels.
* @return object The filtered labels.
*/
function wpse426542_taxonomy_labels( $labels ) {
// Changes the label on the Name field.
$labels->name_field_description = __( 'My Custom Name Description', 'my-plugin' );
// Change any other labels you want, and then...
return $labels;
}
A full list of the labels can be found in the get_taxonomy_labels()
docs.
本文标签: Is there a way to edit noncustom term attributes
版权声明:本文标题:Is there a way to edit non-custom term attributes? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736296854a1929887.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论