Advertisement
devamit

Show the notice only in the “Posts” area of the admin

Jul 5th, 2022
929
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.23 KB | None
  1. add_filter('admin_notice_enable', function($enabled) {
  2.  
  3.     $screen = get_current_screen();
  4.  
  5.     if (isset($screen->post_type) && $screen->post_type !== 'post') {
  6.         $enabled = false;
  7.     }
  8.  
  9.     return $enabled;
  10.  
  11. }, 10, 1);
Advertisement
RAW Paste Data Copied
Advertisement