Changeset 1750361
- Timestamp:
- 10/21/2017 01:47:19 PM (8 years ago)
- Location:
- leaflet-map-widget/trunk
- Files:
-
- 2 edited
-
leaflet-map-widget.php (modified) (8 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
leaflet-map-widget/trunk/leaflet-map-widget.php
r1481018 r1750361 19 19 20 20 */ 21 22 function register_LeafletMap_widget() {23 register_widget( 'LeafletMapwidget' );21 22 function register_LeafletMap_widget() { 23 register_widget( 'LeafletMapwidget' ); 24 24 } 25 25 add_action( 'widgets_init', 'register_LeafletMap_widget' ); … … 29 29 function leafletmapwidget_init() { 30 30 31 $path = dirname(plugin_basename( __FILE__ )) . '/languages/';32 $loaded = load_plugin_textdomain( 'leafletmapwidget', false, $path);31 $path = dirname(plugin_basename( __FILE__ )) . '/languages/'; 32 $loaded = load_plugin_textdomain( 'leafletmapwidget', false, $path); 33 33 } 34 34 35 35 /** 36 36 * Adds LeafletMapWidget widget. … … 55 55 echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title']; 56 56 } 57 58 echo do_shortcode('[leaflet-map address="'.$instance['ad resse'].','.$instance['postcode_town'].'" zoom='.$instance['zoomlevel'].' scrollwheel=1][leaflet-marker]');59 57 58 echo do_shortcode('[leaflet-map address="'.$instance['address'].','.$instance['postcode_town'].'" zoom='.$instance['zoomlevel'].' scrollwheel=1][leaflet-marker]'); 59 60 60 echo $args['after_widget']; 61 61 } … … 64 64 public function form( $instance ) { 65 65 $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'New title', 'leafletmapwidget' ); 66 $adresse = ! empty( $instance['ad resse'] ) ? $instance['adresse'] : __( 'adresse', 'leafletmapwidget' );66 $adresse = ! empty( $instance['address'] ) ? $instance['address'] : __( 'address', 'leafletmapwidget' ); 67 67 $postcode_town = ! empty( $instance['postcode_town'] ) ? $instance['postcode_town'] : __( 'postcode_town', 'leafletmapwidget' ); 68 68 $zoomlevel = ! empty( $instance['zoomlevel'] ) ? $instance['zoomlevel'] : __( '17', 'leafletmapwidget' ); 69 69 70 70 ?> 71 71 <p> … … 73 73 <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>"> 74 74 </p> 75 75 76 76 <p> 77 77 <label for="adresse" ><?php _e('Address','leafletmapwidget'); ?>:</label><br> 78 <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'ad resse' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'adresse' ) ); ?>" type="text" value="<?php echo esc_attr( $adresse ); ?>">78 <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'address' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'address' ) ); ?>" type="text" value="<?php echo esc_attr( $adresse ); ?>"> 79 79 </p> 80 80 <p> … … 82 82 <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'postcode_town' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'postcode_town' ) ); ?>" type="text" value="<?php echo esc_attr( $postcode_town ); ?>"> 83 83 </p> 84 84 85 85 <p> 86 86 <label for="zoomlevel" ><?php _e('Zoomlevel (1 = World , 18 very detailed)','leafletmapwidget'); ?>:</label><br> 87 87 <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'zoomlevel' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'zoomlevel' ) ); ?>" type="number" min=1 max=18 value="<?php echo esc_attr( $zoomlevel ); ?>"> 88 88 </p> 89 90 89 91 90 91 92 92 <?php 93 93 } … … 97 97 $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : ''; 98 98 $instance['postcode_town'] = ( ! empty( $new_instance['postcode_town'] ) ) ? strip_tags( $new_instance['postcode_town'] ) : ''; 99 $instance['ad resse'] = ( ! empty( $new_instance['adresse'] ) ) ? strip_tags( $new_instance['adresse'] ) : '';99 $instance['address'] = ( ! empty( $new_instance['address'] ) ) ? strip_tags( $new_instance['address'] ) : ''; 100 100 $instance['zoomlevel'] = ( ! empty( $new_instance['zoomlevel'] ) ) ? strip_tags( $new_instance['zoomlevel'] ) : ''; 101 101 102 102 return $instance; 103 103 } … … 105 105 } // class LeafletMapWidget 106 106 107 107 108 108 ?> -
leaflet-map-widget/trunk/readme.txt
r1750353 r1750361 4 4 Tags: leaflet, map, widget 5 5 Requires at least: 3.0.1 6 Tested up to: 4. 76 Tested up to: 4.8.2 7 7 Stable tag: trunk 8 8 License: GPLv2 or later
Note: See TracChangeset
for help on using the changeset viewer.