HEX
Server: Apache/2.4.57 (Debian)
System: Linux web-server-k8s-e92jnr3j-6f99bff6b6-rp2wg 6.1.0-22-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.94-1 (2024-06-21) x86_64
User: apache (48)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/sites/1250.info/wp-content/plugins/nm-custom-code/includes/shortcodes/google-map.php
<?php
	
	// Shortcode: nm_gmap
	function nm_shortcode_gmap( $atts, $content = NULL ) {
		extract( shortcode_atts( array(
			'address'		=> 'Amsterdam, The Netherlands',
			'map_type'		=> 'roadmap_custom',
			'map_style'		=> 'paper',
			'height'		=> '',
			'zoom'			=> '18',
            'min_zoom'		=> '1',
			'zoom_controls'	=> '0',
			'scroll_zoom'	=> '0',
			'touch_drag'	=> '0',
			'marker_icon'	=> '',
            'api_key'       => '',
		), $atts ) );
		
        $api_version = 'v=3';
        $api_key = ( strlen( $api_key ) > 0 ) ? '&key=' . $api_key : '';
        
		// Enqueue Google Map scripts
        if ( defined( 'NM_THEME_URI' ) ) {
            wp_enqueue_script( 'google-maps-api', '//maps.google.com/maps/api/js?' . $api_version . $api_key . '&sensor=false', '', '', true );
            wp_enqueue_script( 'nm-google-maps', NM_THEME_URI . '/assets/js/plugins/google-maps.min.js', array( 'jquery', 'google-maps-api' ), NM_THEME_VERSION, true );
        }
		
		static $i = 0;
		$i++;
		
		$marker_icon_url = ( strlen( $marker_icon ) > 0 ) ? wp_get_attachment_url( $marker_icon ) : '';
		
		$map_data_escaped = '
			data-address="' . esc_attr( $address ) . '"
			data-map-type="' . esc_attr( $map_type ) . '"
			data-map-style="' . esc_attr( $map_style ) . '"
			data-zoom="' . esc_attr( $zoom ) . '"
            data-min-zoom="' . esc_attr( $min_zoom ) . '"
			data-zoom-controls="' . esc_attr( $zoom_controls ) . '"
			data-scroll-zoom="' . esc_attr( $scroll_zoom ) . '"
			data-touch-drag="' . esc_attr( $touch_drag ) . '"
			data-marker-icon="' . esc_url( $marker_icon_url ) . '"
		';
		
		$map_classes = 'nm-gmap';
		$map_styles_escaped = '';
		
		if ( strlen( $height > 0 ) ) {
			$map_styles_escaped = ' style="height:' . intval( $height ) . 'px;"';
		} else {
			$map_classes .= ' aspect-ratio';
		}
		
		return '<div id="nm-gmap-' . esc_attr( $i ) . '" ' . $map_data_escaped . ' class="' . esc_attr( $map_classes ) . '"' . $map_styles_escaped . '></div>';
	}
	
	add_shortcode( 'nm_gmap', 'nm_shortcode_gmap' );