?AlkantarClanX12
| Current Path : /home/r/a/n/rankinh/villavanille/wp-content/plugins/drew-core/inc/subscribe-popup/ |
| Current File : /home/r/a/n/rankinh/villavanille/wp-content/plugins/drew-core/inc/subscribe-popup/helper.php |
<?php
if ( ! function_exists( 'drew_core_get_subscribe_popup' ) ) {
/**
* Loads subscribe popup HTML
*/
function drew_core_get_subscribe_popup() {
if ( drew_core_get_option_value( 'admin', 'qodef_enable_subscribe_popup' ) === 'yes' && drew_core_get_option_value( 'admin', 'qodef_subscribe_popup_contact_form' ) !== '' ) {
drew_core_load_subscribe_popup_template();
}
}
// Get subscribe popup HTML
add_action( 'drew_action_before_wrapper_close_tag', 'drew_core_get_subscribe_popup' );
}
if ( ! function_exists( 'drew_core_load_subscribe_popup_template' ) ) {
/**
* Loads HTML template with params
*/
function drew_core_load_subscribe_popup_template() {
$params = array();
$params['title'] = drew_core_get_option_value( 'admin', 'qodef_subscribe_popup_title' );
$params['subtitle'] = drew_core_get_option_value( 'admin', 'qodef_subscribe_popup_subtitle' );
$background_image = drew_core_get_option_value( 'admin', 'qodef_subscribe_popup_background_image' );
$params['content_style'] = ! empty( $background_image ) ? 'background-image: url(' . esc_url( wp_get_attachment_url( $background_image ) ) . ')' : '';
$params['contact_form'] = drew_core_get_option_value( 'admin', 'qodef_subscribe_popup_contact_form' );
$params['enable_prevent'] = drew_core_get_option_value( 'admin', 'qodef_enable_subscribe_popup_prevent' );
$params['prevent_behavior'] = drew_core_get_option_value( 'admin', 'qodef_subscribe_popup_prevent_behavior' );
$holder_classes = array();
$holder_classes[] = ! empty( $params['prevent_behavior'] ) ? 'qodef-sp-prevent-' . $params['prevent_behavior'] : 'qodef-sp-prevent-session';
$params['holder_classes'] = implode( ' ', $holder_classes );
echo drew_core_get_template_part( 'subscribe-popup', 'templates/subscribe-popup', '', $params );
}
}