50,
'vertical' => 50,
);
if ( ! empty( get_post_meta( $popup_id, 'popup_animation', true ) ) ) {
$popup_options['animation'] = get_post_meta( $popup_id, 'popup_animation', true );
}
if ( ! empty( get_post_meta( $popup_id, 'popup_width', true ) ) ) {
$popup_options['width'] = (int) get_post_meta( $popup_id, 'popup_width', true );
}
if ( ! empty( get_post_meta( $popup_id, 'load_duration', true ) ) ) {
$popup_options['load_duration'] = (int) get_post_meta( $popup_id, 'load_duration', true );
}
if ( ! empty( get_post_meta( $popup_id, 'disable_popup_period', true ) ) ) {
$popup_options['popup_period'] = get_post_meta( $popup_id, 'disable_popup_period', true );
}
if ( ! empty( get_post_meta( $popup_id, 'enable_exit_intent', true ) ) ) {
$popup_options['enable_exit_intent'] = get_post_meta( $popup_id, 'enable_exit_intent', true );
}
if ( ! empty( get_post_meta( $popup_id, 'disable_overlay', true ) ) ) {
$popup_options['disable_overlay'] = get_post_meta( $popup_id, 'disable_overlay', true );
}
if ( ! empty( get_post_meta( $popup_id, 'popup_type', true ) ) ) {
$popup_options['popup_type'] = get_post_meta( $popup_id, 'popup_type', true );
}
if ( ! empty( get_post_meta( $popup_id, 'popup_offcanvas_pos', true ) ) ) {
$popup_options['popup_offcanvas_pos'] = get_post_meta( $popup_id, 'popup_offcanvas_pos', true );
}
}
$return = false;
if ( ! empty( $_COOKIE[ 'porto_modal_disable_period_onload_' . $popup_id ] ) ) {
if ( isset( $popup_options['popup_period'] ) && $popup_options['popup_period'] == $_COOKIE[ 'porto_modal_disable_period_onload_' . $popup_id ] ) {
$return = true;
} else {
setcookie( 'porto_modal_disable_period_onload_' . $popup_id, '', time() - 3600 );
}
}
if ( ! $return ) {
$style = '';
if ( empty( $popup_options['builder'] ) ) {
$style .= 'width: calc(100% - ' . ( empty( $porto_settings['grid-gutter-width'] ) ? '30' : (int) $porto_settings['grid-gutter-width'] ) . 'px); max-width: ' . (int) $popup_options['width'] . 'px; ';
if ( is_rtl() ) {
$left = 'right';
$right = 'left';
} else {
$left = 'left';
$right = 'right';
}
if ( ! empty( $popup_options['popup_type'] ) ) { // Off-Canvas
if ( ! empty( $popup_options['popup_offcanvas_pos'] ) ) { // right
$style .= $right . ': 0; top: 0; bottom: 0;';
} else {
$style .= $left . ': 0; top: 0; bottom: 0;';
}
} else {
if ( 50 === (int) $popup_options['horizontal'] ) {
if ( 50 === (int) $popup_options['vertical'] ) {
$style .= 'left: 50%;top: 50%;transform: translate(-50%, -50%);';
} else {
$style .= 'left: 50%;transform: translateX(-50%);';
}
} elseif ( 50 > (int) $popup_options['horizontal'] ) {
$style .= $left . ':' . $popup_options['horizontal'] . '%;';
} else {
$style .= $right . ':' . ( 100 - $popup_options['horizontal'] ) . '%;';
}
if ( 50 === (int) $popup_options['vertical'] ) {
if ( 50 !== (int) $popup_options['horizontal'] ) {
$style .= 'top: 50%;transform: translateY(-50%);';
}
} elseif ( 50 > (int) $popup_options['vertical'] ) {
$style .= 'top:' . $popup_options['vertical'] . '%;';
} else {
$style .= 'bottom:' . ( 100 - $popup_options['vertical'] ) . '%;';
}
}
}
$overlayClass = $popup_options['animation'];
if ( ! empty( $popup_options['popup_type'] ) ) {
if ( ! empty( $popup_options['popup_offcanvas_pos'] ) ) { // right
$overlayClass = 'my-mfp-slide-' . $left;
} else {
$overlayClass = 'my-mfp-slide-' . $right;
}
}
if ( ! empty( $popup_options['enable_exit_intent'] ) ) {
wp_enqueue_script( 'porto-ouibounce', PORTO_JS . '/libs/ouibounce.min.js', array(), PORTO_VERSION, true );
?>
';
} else {
$html = '';
}
$html .= '';
if ( ! empty( get_post_meta( $popup_id, 'popup_offcanvas_bg', true ) ) ) {
echo '';
}
echo porto_filter_output( $html );
}
}
}
}
if ( ! isset( $porto_footer_escaped ) && empty( $porto_block_template ) ) {
wp_footer();
echo "