Skip to content

Commit

Permalink
Merge pull request #97 from omnisend/hide-notices
Browse files Browse the repository at this point in the history
hide all notices except omnisend
  • Loading branch information
Gabiermi authored Apr 15, 2024
2 parents a91651e + 1677b73 commit 8397b41
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 18 deletions.
12 changes: 6 additions & 6 deletions composer.lock

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

2 changes: 1 addition & 1 deletion omnisend/build/connection.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-components', 'wp-element'), 'version' => '2aa75a7bb9ce04a8bf1d');
<?php return array('dependencies' => array('react', 'wp-components', 'wp-element'), 'version' => '34e540b8ddfcf251c71f');
3 changes: 2 additions & 1 deletion omnisend/build/connection.js

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

2 changes: 1 addition & 1 deletion omnisend/build/connection.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion omnisend/build/notices.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-element'), 'version' => 'a6babe65506454df0983');
<?php return array('dependencies' => array('react', 'wp-element'), 'version' => '3821d14dadbfd56a6a55');
6 changes: 3 additions & 3 deletions omnisend/build/notices.js

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

2 changes: 1 addition & 1 deletion omnisend/build/notices.js.map

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

3 changes: 2 additions & 1 deletion omnisend/class-omnisend-core-bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ 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>.notice:not(.omnisend-notice) { display: none !important; }</style>';
echo '<style>[class*="notice"]:not([class*="components"], .omnisend-notice, .notice), .notice:not(.omnisend-notice) { display: none !important; }</style>';
}
}
}
Expand Down Expand Up @@ -300,6 +300,7 @@ function ( $suffix ) {
array(
'nonce' => wp_create_nonce( 'wp_rest' ),
'action_nonce' => wp_create_nonce( 'connect' ),
'site_url' => site_url(),
)
);
}
Expand Down
4 changes: 2 additions & 2 deletions omnisend/src/connection/components/connection-page-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const ConnectionPageLayout = () =>
formData.append( 'api_key', apiKey );
formData.append( 'action_nonce', omnisend_connection.action_nonce );

fetch( '/wp-json/omnisend/v1/connect', {
fetch( omnisend_connection.site_url + '/wp-json/omnisend/v1/connect', {
method: 'POST',
body: formData,
headers: {
Expand Down Expand Up @@ -59,7 +59,7 @@ const ConnectionPageLayout = () =>
<div className="omnisend-page-layout">
{error && (
<div className="omnisend-spacing-mb-8">
<Notice status="error">{error}</Notice>
<Notice className='omnisend-notice' status="error">{error}</Notice>
</div>
)}
<ConnectionLogos />
Expand Down
2 changes: 1 addition & 1 deletion omnisend/src/notices/components/discount-notice.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const DiscountNotice = () =>
{
return (
<div class="omnisend-custom-notice">
<div class="omnisend-custom-notice omnisend-notice">
<img src="/wp-content/plugins/omnisend/assets/img/omnisend-notice-discount-icon.svg" />

<div>Get 30% off Omnisend for 6 months with code <span class="omnisend-custom-notice-strong-text">ONLYHOSTINGER30</span></div>
Expand Down

0 comments on commit 8397b41

Please sign in to comment.