admin管理员组文章数量:1122846
I want to use pods custom fields inside a page and i would like the pods editor to appear only if the page is using a specific page template, for exemple if the page is using my galerie.php template
I can't find a way to do it and at this point im not sure if it's even possible.
i'm using :
- wordpress 6.2.2
- Pods 2.9
- A child theme of 2021
I want to use pods custom fields inside a page and i would like the pods editor to appear only if the page is using a specific page template, for exemple if the page is using my galerie.php template
I can't find a way to do it and at this point im not sure if it's even possible.
i'm using :
- wordpress 6.2.2
- Pods 2.9
- A child theme of 2021
1 Answer
Reset to default 1This will remove the meta box for a Pods field group called 'More Fields' from the editor for a page not using a certain page template:
// remove meta box if page does not use a certain page template
add_action('admin_head', function() {
$template = get_page_template_slug(get_queried_object_id());
if('my-page-template.php' !== $template) {
remove_meta_box('pods-meta-more-fields', 'page', 'normal');
}
});
本文标签: Show Pods Custom Fields Editor when a page is using a specific template in WordPress
版权声明:本文标题:Show Pods Custom Fields Editor when a page is using a specific template in WordPress 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736307587a1933364.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论