| @@ -24,8 +24,10 @@ | ||
| 24 | 24 | */ |
| 25 | 25 | private function __construct() { |
| 26 | 26 | add_action( 'admin_init', [ $this, 'check_installation_time' ], 10 ); |
| 27 | 27 | add_action( 'admin_init', [ $this, 'notice_actions' ], 5 ); |
| 28 | + | |
| 29 | + $this->remove_all_notices(); | |
| 28 | 30 | } |
| 29 | 31 | |
| 30 | 32 | /** |
| 31 | 33 | * Check if review notice should be shown or not |
| @@ -294,6 +296,23 @@ | ||
| 294 | 296 | } |
| 295 | 297 | </style> |
| 296 | 298 | <?php |
| 297 | 299 | } |
| 300 | + } | |
| 301 | + | |
| 302 | + /** | |
| 303 | + * Remove admin notices | |
| 304 | + */ | |
| 305 | + public function remove_all_notices() { | |
| 306 | + add_action( | |
| 307 | + 'in_admin_header', | |
| 308 | + function () { | |
| 309 | + $screen = get_current_screen(); | |
| 310 | + if ( in_array( $screen->base, [ 'shopbuilder_page_rtsb-get-help' ], true ) ) { | |
| 311 | + remove_all_actions( 'admin_notices' ); | |
| 312 | + remove_all_actions( 'all_admin_notices' ); | |
| 313 | + } | |
| 314 | + }, | |
| 315 | + 1000 | |
| 316 | + ); | |
| 298 | 317 | } |
| 299 | 318 | } |