Edit post locked notification dialog on edit post screen (post.php)... hook maybe?

Creating a management application for my company and other utility companies... would be nice to remove the Preview butt

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
Add a comment  | 

1 Answer 1

Reset to default 2

I 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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信