Skip to content

Commit

Permalink
Add newsletter signup notice to omniform plugin pages only.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrtashjian committed May 24, 2023
1 parent b4dd902 commit e5d500d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions includes/Plugin/PluginServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,27 @@ public function disable_admin_notices() {
remove_all_actions( 'admin_notices' );
remove_all_actions( 'all_admin_notices' );
// Add our own notices after this.

add_action( 'admin_notices', array( $this, 'render_newsletter_notice' ) );
}

/**
* Render the newsletter notice.
*/
public function render_newsletter_notice() {
$current_screen = get_current_screen();

// Don't show the notice on response editor screens.
if ( 'omniform_response' === $current_screen->id ) {
return;
}

printf(
'<div class="notice notice-info"><p>%s <a href="%s" target="_blank">%s</a></p></div>',
esc_html__( 'Want to stay up to date with OmniForm news?', 'omniform' ),
esc_url( 'https://omniform.io/omniform/newsletter?utm_source=omniform&utm_medium=plugin&utm_content=admin_notice' ),
esc_html__( 'Sign up for our newsletter!', 'omniform' )
);
}

/**
Expand Down

0 comments on commit e5d500d

Please sign in to comment.