adp = $adp; $this->version = $version; } /** * Initialize */ public function wp_footer() { $query = new WP_Query(); // Get all popups. $popups = $query->query( array( 'post_status' => 'publish', 'post_type' => 'adp-popup', 'posts_per_page' => -1, ) ); // Looop popups. foreach ( $popups as $popup ) { $popup_type = adp_get_post_meta( $popup->ID, '_adp_popup_type', true, 'content' ); $popup_location = adp_get_post_meta( $popup->ID, '_adp_popup_location', true, 'center' ); $popup_preview_image = adp_get_post_meta( $popup->ID, '_adp_popup_preview_image', true, 'left' ); $popup_info_text = adp_get_post_meta( $popup->ID, '_adp_popup_info_text', true ); $popup_info_buton_label = adp_get_post_meta( $popup->ID, '_adp_popup_info_buton_label', true ); $popup_info_button_action = adp_get_post_meta( $popup->ID, '_adp_popup_info_button_action', true, 'link' ); $popup_info_button_link = adp_get_post_meta( $popup->ID, '_adp_popup_info_button_link', true ); $popup_limit_display = adp_get_post_meta( $popup->ID, '_adp_popup_limit_display', true, 1 ); $popup_limit_lifetime = adp_get_post_meta( $popup->ID, '_adp_popup_limit_lifetime', true, 30 ); $popup_open_trigger = adp_get_post_meta( $popup->ID, '_adp_popup_open_trigger', true, 'delay' ); $popup_open_delay_number = adp_get_post_meta( $popup->ID, '_adp_popup_open_delay_number', true, 1 ); $popup_open_scroll_position = adp_get_post_meta( $popup->ID, '_adp_popup_open_scroll_position', true, 10 ); $popup_open_scroll_type = adp_get_post_meta( $popup->ID, '_adp_popup_open_scroll_type', true, '%' ); $popup_open_manual_selector = adp_get_post_meta( $popup->ID, '_adp_popup_open_manual_selector', true ); $popup_close_trigger = adp_get_post_meta( $popup->ID, '_adp_popup_close_trigger', true, 'none' ); $popup_close_delay_number = adp_get_post_meta( $popup->ID, '_adp_popup_close_delay_number', true, 30 ); $popup_close_scroll_position = adp_get_post_meta( $popup->ID, '_adp_popup_close_scroll_position', true, 10 ); $popup_close_scroll_type = adp_get_post_meta( $popup->ID, '_adp_popup_close_scroll_type', true, '%' ); $popup_open_animation = adp_get_post_meta( $popup->ID, '_adp_popup_open_animation', true, 'popupOpenFade' ); $popup_exit_animation = adp_get_post_meta( $popup->ID, '_adp_popup_exit_animation', true, 'popupExitFade' ); $popup_content_box_width = adp_get_post_meta( $popup->ID, '_adp_popup_content_box_width', true, 500 ); $popup_notification_box_width = adp_get_post_meta( $popup->ID, '_adp_popup_notification_box_width', true, 400 ); $popup_notification_bar_width = adp_get_post_meta( $popup->ID, '_adp_popup_notification_bar_width', true, 1024 ); $popup_light_close = adp_get_post_meta( $popup->ID, '_adp_popup_light_close', true, false ); $popup_display_overlay = adp_get_post_meta( $popup->ID, '_adp_popup_display_overlay', true, false ); $popup_mobile_disable = adp_get_post_meta( $popup->ID, '_adp_popup_mobile_disable', true ); $popup_body_scroll_disable = adp_get_post_meta( $popup->ID, '_adp_popup_body_scroll_disable', true ); $popup_overlay_close = adp_get_post_meta( $popup->ID, '_adp_popup_overlay_close', true ); $popup_esc_close = adp_get_post_meta( $popup->ID, '_adp_popup_esc_close', true ); $popup_f4_close = adp_get_post_meta( $popup->ID, '_adp_popup_f4_close', true ); // Check show popup. if ( ! adp_is_popup_visible( $popup->ID ) ) { continue; } $has_post_thumbnail = has_post_thumbnail( $popup->ID ) && 'none' !== $popup_preview_image; // Default location for notification bar. if ( 'notification-bar' === $popup_type ) { if ( 'top' !== $popup_location && 'bottom' !== $popup_location ) { $popup_location = 'bottom'; } } // Set popup width. if ( 'content' === $popup_type ) { $popup_width = $popup_content_box_width . 'px'; if ( $has_post_thumbnail ) { $popup_width = ( $popup_content_box_width * 2 ) . 'px'; } } elseif ( 'notification-box' === $popup_type ) { $popup_width = $popup_notification_box_width . 'px'; } else { $popup_width = '100%'; } // Set Popup CSS. $popup_style = sprintf( 'width:%s;', $popup_width ); // Set Outer CSS. $outer_style = sprintf( 'max-width:%s;', '100%' ); if ( 'notification-bar' === $popup_type ) { $outer_style = sprintf( 'max-width:%s;', $popup_notification_bar_width . 'px' ); } // Popup clasess. $class = 'adp-popup'; $class .= ' adp-popup-type-' . esc_attr( $popup_type ); $class .= ' adp-popup-location-' . esc_attr( $popup_location ); $class .= ' adp-preview-image-' . esc_attr( $popup_preview_image ); $class .= ' adp-preview-image-' . esc_attr( $has_post_thumbnail ? 'yes' : 'no' ); // Filter clasess. $class = apply_filters( 'adp_popup_clasess', $class, $popup->ID, $popup_type, $popup_location ); ?>
ID, 'large', array( 'class' => 'adp-lazyload-disabled' ) ); ?>
post_content ); echo do_shortcode( $content ); // XSS. ?>
post_content ); $blocks_css = cnvs_gutenberg()->parse_blocks_css( $blocks ); if ( $blocks_css ) { echo sprintf( '', $blocks_css ); // XSS. } } } } /** * Fire the wp_head action. */ public function wp_head() { ?> adp, plugin_dir_url( __FILE__ ) . 'js/advanced-popups-public.js', array( 'jquery' ), $this->version, false ); // Styles. wp_enqueue_style( $this->adp, adp_style( plugin_dir_url( __FILE__ ) . 'css/advanced-popups-public.css' ), array(), $this->version, 'all' ); // Add RTL support. wp_style_add_data( $this->adp, 'rtl', 'replace' ); } }