500, 'sticky' => 'off' ); wp_enqueue_script( 'aesop-map-script', AI_CORE_URL.'/public/includes/libs/leaflet/leaflet.js' ); wp_enqueue_style( 'aesop-map-style', AI_CORE_URL.'/public/includes/libs/leaflet/leaflet.css', AI_CORE_VERSION, true ); $atts = apply_filters( 'aesop_map_defaults', shortcode_atts( $defaults, $atts ) ); // sticky maps class $sticky = 'off' !== $atts['sticky'] ? sprintf( 'aesop-sticky-map-%s', esc_attr( $atts['sticky'] ) ) : null; // clean height $get_height = 'off' == $atts['sticky'] ? preg_replace( '/[^0-9]/', '', $atts['height'] ) : null; $height = $get_height ? sprintf( 'style="height:%spx;"', $get_height ) : null; // custom classes $classes = function_exists( 'aesop_component_classes' ) ? aesop_component_classes( 'map', '' ) : null; // get markers - since 1.3 $markers = get_post_meta( get_the_ID(), 'ase_map_component_locations', false ); // filterable map marker waypoint offset - since 1.3 // 50% means when the id hits 50% from the top the waypoint will fire $marker_waypoint_offset = apply_filters( 'aesop_map_waypoint_offset', '50%' ); // enable map component for all post types $default_location = true;//is_single(); $location = apply_filters( 'aesop_map_component_appears', $default_location ); static $instance = 0; $instance++; $unique = sprintf( '%s-%s', get_the_ID(), $instance ); ob_start(); do_action( 'aesop_map_before', $atts, $unique ); $url = admin_url( 'post.php?post='.get_the_ID().'&action=edit' ); $edit_map = __( 'Add Map Markers', 'aesop-core' ); $add_markers = sprintf( '(%s)', $url, $edit_map, $edit_map ); if ( empty( $markers ) && is_user_logged_in() && current_user_can( 'edit_post', get_the_ID() ) && ! function_exists( 'lasso_editor_components' ) ) { ?>
class="aesop-component aesop-map-component " >
array( $this, 'aesop_map_marker_sc' ) ) ); } } public function aesop_map_loader() { global $post; $id = isset( $post ) ? $post->ID : null; $markers = isset( $post ) ? get_post_meta( $id, 'ase_map_component_locations', false ) : false; $start = isset( $post ) && self::get_map_meta( $id, 'ase_map_component_start' ) ? self::get_map_meta( $id, 'ase_map_component_start' ) : self::start_fallback( $markers ); $zoom = isset( $post ) && self::get_map_meta( $id, 'ase_map_component_zoom' ) ? self::get_map_meta( $id, 'ase_map_component_zoom' ) : 12; // enable map component for all post types $default_location = true;//is_single(); $location = apply_filters( 'aesop_map_component_appears', $default_location ); $tiles = isset( $post ) ? aesop_map_tile_provider( $post->ID ) : false; if ( function_exists( 'aesop_component_exists' ) && aesop_component_exists( 'map' ) && ( $location ) ) { ?> '', 'hidden' => '' ); $atts = shortcode_atts( $defaults, $atts ); // let this be used multiple times static $instance = 0; $instance++; $style =""; if ( $atts[ 'hidden'] =='on') { $style = 'style="visibility:hidden;"'; } $out = sprintf( '

%s

', $instance, $style, esc_html( $atts[ 'title'] ) ); return apply_filters( 'aesop_map_marker_output', $out ); } } new AesopMapComponent;