Creating a management application for my company and other utility companies... would be nice to remove the Preview button via php without a core hack...
I have to hack the core just a little anyhow and am keeping detailed records but if it is possible not to do this that would be very good.
Any feedback much appreciated
Creating a management application for my company and other utility companies... would be nice to remove the Preview button via php without a core hack...
I have to hack the core just a little anyhow and am keeping detailed records but if it is possible not to do this that would be very good.
Any feedback much appreciated
Share Improve this question asked Oct 29, 2019 at 0:42 Robert Ruby IIRobert Ruby II 134 bronze badges 2- Are you using the Block Editor or the Classic Editor? The solution will depend on which editor you're supporting. Also, why do you "have" to hack core? – WebElaine Commented Oct 29, 2019 at 19:41
- Because I am creating a project management system for my utility company and there are things that are better done via php than css or js. I am using actions almost everywhere. I think I have 2 hacks on the list. I'll have to look them up and ask here if there is a better solution. I have no worries thought of an update overwriting as I will have updates turned off so I can assess diff's as I need to... definitely trying to avoid it at all costs. – Robert Ruby II Commented Oct 29, 2019 at 23:54
1 Answer
Reset to default 2I believe the easiest approach is to hide that Preview button via CSS. Here is a snippet or you can add that style to a pre-existing wp-admin stylesheet that you might have already included.
add_action( 'admin_head-post.php', function(){
echo '<style>';
echo '.edit-post-header__settings .editor-post-preview { display: none !important; }';
echo '</style>';
});
I tried digging through the core and I don't see any way to filter those links out.
Hope that helps!!
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745045001a4608041.html
评论列表(0条)