Skip to content

Commit

Permalink
Merge pull request #108 from omnisend/hide-notices-fix
Browse files Browse the repository at this point in the history
fix notice hide scope
  • Loading branch information
Gabiermi authored May 2, 2024
2 parents 39914c2 + 469a9f3 commit 598d1cf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
32 changes: 16 additions & 16 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions omnisend/class-omnisend-core-bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,9 @@ public static function load_omnisend_site_styles(): void {
}

public static function hide_notices(): void {
if ( isset( $_SERVER['REQUEST_URI'] ) ) {
$request_uri = esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) );
if ( strpos( $request_uri, '/wp-admin/admin.php?page=omnisend' ) !== false ) {
echo '<style>[class*="notice"]:not([class*="components"], .omnisend-notice, .notice), .notice:not(.omnisend-notice) { display: none !important; }</style>';
}
$screen = get_current_screen();
if ( $screen && ( $screen->id === 'toplevel_page_omnisend' || $screen->id === 'omnisend-email-marketing_page_omnisend-app-market' ) ) {
echo '<style>[class*="notice"]:not([class*="components"], .omnisend-notice, .notice), .notice:not(.omnisend-notice) { display: none !important; }</style>';
}
}

Expand Down

0 comments on commit 598d1cf

Please sign in to comment.