HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/karjerosdiena.lt/wp-content/plugins/js_composer/include/classes/shortcodes/vc-goo-maps.php
<?php
/**
 * Class that handles specific [vc_goo_maps] shortcode.
 *
 * @see js_composer/include/templates/shortcodes/vc_goo_maps.php
 *
 * @since 8.3
 */

if ( ! defined( 'ABSPATH' ) ) {
	die( '-1' );
}

/**
 * Class WPBakeryShortCode_Vc_Goo_Maps
 *
 * @since 8.3
 */
class WPBakeryShortCode_Vc_Goo_Maps extends WPBakeryShortCode {

	/**
	 * Create iframe link base on user input attributes.
	 *
	 * @since 8.3
	 * @param array $atts
	 * @return string
	 */
	public function getIframeLink( $atts ) {

		$zoom = absint( $atts['zoom'] );
		if ( $zoom < 0 ) {
			$zoom = 0;
		} elseif ( $zoom > 22 ) {
			$zoom = 22;
		}

		$params = [
			rawurlencode( $atts['location'] ),
			esc_attr( $atts['type'] ),
			$zoom,
		];

		$url = 'https://maps.google.com/maps?q=%1$s&amp;t=%2$s&amp;z=%3$d&amp;output=embed&amp;iwloc=near';

		return vsprintf( $url, $params );
	}
}