is_code_snippets_screen( $screen ) ) { return; } if ( ! apply_filters( 'code_snippets/admin/filter_foreign_notices', true ) ) { return; } add_action( 'admin_head', [ $this, 'print_fallback_styles' ] ); } /** * Print inline styles that hide foreign notices in the notice region. * * Printed only on the plugin's own screens, so notices are matched at any depth: * each screen renders into its own container, and other plugins inject relative * to whichever wrapper they find. * * @return void */ public function print_fallback_styles() { ?> admin ) ) { return false; } foreach ( code_snippets()->admin->menus as $menu ) { foreach ( $menu->get_hooknames() as $hookname ) { foreach ( [ $hookname, "$hookname-network" ] as $candidate ) { if ( $screen->id === $candidate || $screen->base === $candidate ) { return true; } } } } return false; } }