admin管理员组文章数量:1122846
How do I delete or remove the word Delete Permanently in uploading files? I wanted to remove this permanently so that the users won't keep deleting files which are not supposed to delete.
I use this code:
.button-link.delete-attachment{display:none}
But the problem of this, if the user uses the inspect element, they can just change it to display:block
to show the delete button. Using CSS is not an option.
Is there a function code here to remove this? Or where can I find the core file in wp-admin
folder, so that I could delete the <div>
element manually?
How do I delete or remove the word Delete Permanently in uploading files? I wanted to remove this permanently so that the users won't keep deleting files which are not supposed to delete.
I use this code:
.button-link.delete-attachment{display:none}
But the problem of this, if the user uses the inspect element, they can just change it to display:block
to show the delete button. Using CSS is not an option.
Is there a function code here to remove this? Or where can I find the core file in wp-admin
folder, so that I could delete the <div>
element manually?
1 Answer
Reset to default 0This might do the trick!
css:
.media-sidebar .details .edit-attachment {
display: none;
}
.media-sidebar .details .delete-attachment {
display: none;
}
And this:
foreach( array( 'post.php', 'post-new.php' ) as $hook )
add_action( "admin_print_styles-$hook", 'admin_styles_so_25894288');
function admin_styles_so_25894288() {
global $typenow;
if( 'post' !== $typenow )
return;
?>
<style>
.media-sidebar .details .delete-attachment
{
display: block;
}
.media-sidebar .details .edit-attachment
{
display: block;
}
</style>
<?php
}
本文标签: attachmentsRemoving delete permanently button in uploading files media
版权声明:本文标题:attachments - Removing delete permanently button in uploading files media 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736291762a1928792.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论