function delicious_map_shortcode($atts, $content = null)
{
    extract(shortcode_atts(array("button_text" => '', "latitude" => '37.422117', "longitude" => '-122.084053', 'pin_title' => 'Company Headquarters', 'pin_desc' => 'Now that you visited our website, how about <br/> checking out our office too?'), $atts));
    $rnd_id = '';
    if (function_exists('dt_random_id')) {
        $rnd_id = dt_random_id(3);
    }
    $token = wp_generate_password(5, false, false);
    $site_url = get_template_directory_uri();
    wp_enqueue_script('dt-api-map', '//maps.google.com/maps/api/js?sensor=false', false);
    wp_enqueue_script('dt-custom-map', get_template_directory_uri() . '/js/custom/custom-map.js', array('dt-api-map'), '1.0', false);
    wp_localize_script('dt-custom-map', 'dt_map_' . $token, array('id' => $rnd_id, 'site_url' => $site_url, 'latitude' => $latitude, 'longitude' => $longitude, 'pin_title' => $pin_title, 'pin_desc' => $pin_desc));
    $output = '';
    $output .= '<div class="map-wrapper" id="delicious_map_' . $rnd_id . '" data-token="' . $token . '">';
    //$output .='<a class="button-map close-map"><span>'.$button_text.'</span></a>';
    $output .= '<div id="google_map_' . $rnd_id . '" class="derm-map"></div>';
    $output .= '</div>';
    return $output;
}
Ejemplo n.º 2
0
<?php

$output = $dt_id = $dt_bg_image = $dt_bg_repeat = $dt_bg_color = $dt_color_opacity = $dt_text_scheme = $dt_class = $dt_no_mb = $dt_row_type = $dt_youtube_url = $video_raster = '';
extract(shortcode_atts(array('dt_id' => '', 'bg_image' => '', 'dt_bg_repeat' => '', 'bg_color' => '', 'dt_color_opacity' => '', 'dt_text_scheme' => '', 'dt_padding_top' => '', 'dt_padding_bottom' => '', 'dt_class' => '', 'dt_no_mb' => '', 'dt_row_type' => '', 'dt_youtube_url' => '', 'video_raster' => ''), $atts));
wp_enqueue_style('js_composer_front');
wp_enqueue_script('wpb_composer_front_js');
wp_enqueue_style('js_composer_custom_css');
global $smof_data;
$rnd_id = dt_random_id(3);
$token = wp_generate_password(5, false, false);
// youtube video bg
if ($dt_row_type != '' && $dt_youtube_url != '') {
    wp_enqueue_script('dt-yotube-video-bg', get_template_directory_uri() . '/js/jquery-ytp.js', array('jquery'), '1.0', true);
    wp_localize_script('dt-yotube-video-bg', 'dt_vbg_' . $token, array('id' => $rnd_id));
}
$video_bg = '';
$dt_vid = '#' . $dt_id;
if ($dt_row_type != '' && $dt_youtube_url != '') {
    $boolv = 'false';
    if ($video_raster != '') {
        $boolv = 'true';
    }
    $video_bg = 'data-property="{videoURL: \'' . $dt_youtube_url . '\', containment: \'' . $dt_vid . '\', autoPlay:true, realfullscreen: true, addRaster: ' . $boolv . ', showControls: false, mute:true, startAt:0, opacity:1}"';
}
wp_enqueue_script('dt-custom-parallax', get_template_directory_uri() . '/js/custom/custom-parallax.js', array('dt-custom-isotope-blog', 'dt-custom-isotope-portfolio'), '1.0', true);
wp_localize_script('dt-custom-parallax', 'dt_parallax_' . $token, array('id' => $rnd_id));
$dt_class = $this->getExtraClass($dt_class);
$style = '';
$parallax_bg = '';
if (!empty($bg_image)) {
    $parallax_bg = 'parallax-bag-' . $rnd_id;