admin管理员组文章数量:1279178
For a custom role, I've to remove/hide the email and URL fields in the author box inside the Edit Comment area in WP admin. Only the name field should be visible there.
I've to keep the URL and email field enabled for comments in the discussion settings, and can't hide the fields only on the frontend using CSS. They should be removed entirely from the source code of the page, so backend code which removes the fields would be the most likely approach.
Example URL of an edit comment page in WP admin: wp-admin/comment.php?action=editcomment&c=544499
.
The form comes from wp-admin/edit-form-comment.php
, which is called from wp-admin/comment.php
. Can anyone suggest a way to remove the 2 fields from showing up in the form? Thanks.
For a custom role, I've to remove/hide the email and URL fields in the author box inside the Edit Comment area in WP admin. Only the name field should be visible there.
I've to keep the URL and email field enabled for comments in the discussion settings, and can't hide the fields only on the frontend using CSS. They should be removed entirely from the source code of the page, so backend code which removes the fields would be the most likely approach.
Example URL of an edit comment page in WP admin: wp-admin/comment.php?action=editcomment&c=544499
.
The form comes from wp-admin/edit-form-comment.php
, which is called from wp-admin/comment.php
. Can anyone suggest a way to remove the 2 fields from showing up in the form? Thanks.
1 Answer
Reset to default 0There is no filter hook to customize comment edit fields on admin page. However you can hide those two fields using CSS, add the code below on your active theme.
function wp_ste_remove_commentfields() {
global $pagenow;
if ( $pagenow != 'comment.php' ) return;
?>
<style>
.editcomment tr:nth-child(2),
.editcomment tr:nth-child(3) {
display: none;
}
</style>
<?php
}
add_action( 'admin_print_styles', 'wp_ste_remove_commentfields' );
本文标签: How to remove some author fields from the edit comment page in wpadmin
版权声明:本文标题:How to remove some author fields from the edit comment page in wp-admin? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741253812a2366287.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论