Noptin_Popups::display_popups()
Displays popups on the front end
Return Return
(void)
Source Source
File: includes/class-noptin-popups.php
public function display_popups() { // Abort if this is an admin page... if ( is_admin() || is_noptin_actions_page() || is_customize_preview() ) { return; } // ...or the user is hiding all popups. if ( ! empty( $_GET['noptin_hide'] ) ) { return; } // Do not show on elementor previews. if ( isset( $_GET['elementor-preview'] ) ) { return; } // Do not show on Ninja Forms previews. if ( isset( $_GET['nf_preview_form'] ) || isset( $_GET['nf_iframe'] ) ) { return; } /** * Fires before popups are displayed * * @since 1.0.5 */ do_action( 'before_noptin_popup_display', $this ); $popups = $this->get_popups(); foreach ( $popups as $popup ) { // Prepare the form. $form = noptin_get_optin_form( $popup ); // Can it be displayed? if ( $form->can_show() ) { echo '<div class="noptin-popup-template-holder">'; echo $form->get_html(); echo '</div>'; } } /** * Fires after popups have been displayed * * @since 1.0.5 */ do_action( 'after_noptin_popup_display', $this ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.5 | Introduced. |