popmake_emodal_shortcode_modal( $atts,  $content = null )


Description Description


Source Source

File: includes/importer/easy-modal-v2.php

function popmake_emodal_shortcode_modal( $atts, $content = null ) {
	$atts = shortcode_atts(
		apply_filters( 'emodal_shortcode_modal_default_atts', array(
			'id'               => "",
			'theme_id'         => null,
			'title'            => null,
			'overlay_disabled' => null,
			'size'             => null,
			'width'            => null,
			'widthUnit'        => null,
			'height'           => null,
			'heightUnit'       => null,
			'location'         => null,
			'positionTop'      => null,
			'positionLeft'     => null,
			'positionBottom'   => null,
			'positionRight'    => null,
			'positionFixed'    => null,
			'animation'        => null,
			'animationSpeed'   => null,
			'animationOrigin'  => null,
			'overlayClose'     => null,
			'escClose'         => null,
			// Deprecated
			'theme'            => null,
			'duration'         => null,
			'direction'        => null,
			'overlayEscClose'  => null,
		) ),
		apply_filters( 'emodal_shortcode_modal_atts', $atts )
	);

	$new_shortcode_atts = array(
		'id'               => $atts['id'],
		'emodal_id'        => $atts['id'],
		'theme_id'         => $atts['theme_id'],
		'title'            => $atts['title'],
		'overlay_disabled' => $atts['overlay_disabled'],
		'size'             => $atts['size'],
		'width'            => $atts['width'],
		'width_unit'       => $atts['widthUnit'],
		'height'           => $atts['height'],
		'height_unit'      => $atts['heightUnit'],
		'location'         => $atts['location'],
		'position_top'     => $atts['positionTop'],
		'position_left'    => $atts['positionLeft'],
		'position_bottom'  => $atts['positionBottom'],
		'position_right'   => $atts['positionRight'],
		'position_fixed'   => $atts['positionFixed'],
		'animation_type'   => $atts['animation'],
		'animation_speed'  => $atts['animationSpeed'],
		'animation_origin' => $atts['animationOrigin'],
		'overlay_click'    => $atts['overlayClose'],
		'esc_press'        => $atts['escClose']
	);

	$shortcode = '[popup ';

	foreach ( $new_shortcode_atts as $attr => $val ) {
		if ( $val && ! empty( $val ) ) {
			$shortcode .= $attr . '="' . $val . '" ';
		}
	}

	$shortcode .= ']' . $content . '[/popup]';

	return do_shortcode( $shortcode );
}

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.