Changeset 3008945
- Timestamp:
- 12/12/2023 05:29:16 PM (2 years ago)
- Location:
- simple-location
- Files:
-
- 10 edited
- 1 copied
-
tags/5.0.19 (copied) (copied from simple-location/trunk)
-
tags/5.0.19/includes/class-geo-base.php (modified) (1 diff)
-
tags/5.0.19/includes/class-location-plugins.php (modified) (2 diffs)
-
tags/5.0.19/readme.txt (modified) (2 diffs)
-
tags/5.0.19/simple-location.php (modified) (1 diff)
-
tags/5.0.19/templates/loc-metabox.php (modified) (4 diffs)
-
trunk/includes/class-geo-base.php (modified) (1 diff)
-
trunk/includes/class-location-plugins.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/simple-location.php (modified) (1 diff)
-
trunk/templates/loc-metabox.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simple-location/tags/5.0.19/includes/class-geo-base.php
r2974027 r3008945 1130 1130 delete_post_meta( $post_id, 'venue_id' ); 1131 1131 } 1132 } elseif ( isset( $_POST['venue_radius'] ) && is_numeric( $_POST['venue_radius'] ) ) { 1132 } else { 1133 if ( isset( $_POST['venue_radius'] ) && is_numeric( $_POST['venue_radius'] ) ) { 1133 1134 update_post_meta( $post_id, 'venue_radius', intval( $_POST['venue_radius'] ) ); 1134 } else { 1135 delete_post_meta( $post_id, 'venue_radius' ); 1135 } else { 1136 delete_post_meta( $post_id, 'venue_radius' ); 1137 } 1138 if ( isset( $_POST['venue_url'] ) ) { 1139 update_post_meta( $post_id, 'venue_url', sanitize_url( $_POST['venue_url'] ) ); 1140 } else { 1141 delete_post_meta( $post_id, 'venue_url' ); 1142 } 1143 1136 1144 } 1137 1145 self::save_meta( 'post', $post_id ); -
simple-location/tags/5.0.19/includes/class-location-plugins.php
r2974027 r3008945 152 152 $meta = $args['meta_input']; 153 153 154 // If there are no location based properties then exit this. 155 if ( ! isset( $properties['checkin'] ) && ! isset( $properties['location'] ) && ! isset( $properties['latitude'] ) && ! isset( $properties['longitude'] ) && ! isset( $meta['geo_latitude'] ) && ! isset( $meta['geo_longitude'] ) ) { 156 return; 157 } 158 159 if ( isset( $properties['published'] ) ) { 160 $published = new DateTime( $properties['published'][0] ); 161 } else { 162 $published = new DateTime( 'now', wp_timezone() ); 163 } 164 154 165 if ( isset( $meta['geo_longitude'] ) && $meta['geo_latitude'] ) { 155 if ( isset( $properties['published'] ) ) {156 $published = new DateTime( $properties['published'][0] );157 } else {158 $published = new DateTime();159 }160 166 // Always assume a checkin is to a building level option 161 167 if ( isset( $properties['checkin'] ) ) { … … 194 200 } 195 201 196 // If there are no location based properties then exit this.197 if ( ! isset( $properties['checkin'] ) && ! isset( $properties['location'] ) && ! isset( $properties['latitude'] ) && ! isset( $properties['longitude'] ) ) {198 return;199 }200 202 201 203 if ( isset( $properties['location'] ) && ! wp_is_numeric_array( $properties['location'] ) ) { -
simple-location/tags/5.0.19/readme.txt
r2994608 r3008945 4 4 Requires at least: 4.9 5 5 Tested up to: 6.4 6 Stable tag: 5.0.1 86 Stable tag: 5.0.19 7 7 Requires PHP: 5.6 8 8 License: GPLv2 or later … … 288 288 289 289 == Changelog == 290 291 = 5.0.19 ( 2023-12-12 ) = 292 * Pulldown will set option by default 293 * Fix micropub integration to add additional check 290 294 291 295 = 5.0.18 ( 2023-11-11 ) = -
simple-location/tags/5.0.19/simple-location.php
r2994608 r3008945 4 4 * Plugin URI: https://wordpress.org/plugins/simple-location/ 5 5 * Description: Adds Location to WordPress 6 * Version: 5.0.1 86 * Version: 5.0.19 7 7 * Requires at least: 4.9 8 8 * Requires PHP: 7.0 -
simple-location/tags/5.0.19/templates/loc-metabox.php
r2994608 r3008945 15 15 if ( 'venue' === $type ) { 16 16 $geodata['venue_radius'] = get_post_meta( get_the_ID(), 'venue_radius', true ); 17 $geodata['venue_url'] = get_post_meta( get_the_ID(), 'venue_url', true ); 17 18 } else { 18 19 $geodata['venue_id'] = get_post_meta( get_the_ID(), 'venue_id', true ); … … 23 24 $location = wp_get_object_terms( get_the_ID(), 'location', array( 'fields' => 'ids' ) ); 24 25 $location = count( $location ) >= 1 ? $location[0] : ''; 25 $display_name = ifset( $geodata['address'] ); 26 if ( array_key_exists( 'venue_id', $geodata ) && $geodata['venue_id'] ) { 27 $display_name = get_the_title( $geodata['venue_id'] ); 28 } else { 29 $display_name = ifset( $geodata['address'] ); 30 } 26 31 27 32 $public = array_key_exists( 'visibility', $geodata ) ? $geodata['visibility'] : get_option( 'geo_public' ); … … 77 82 <input class="widefat" type="number" name="venue_radius" id="venue_radius" step="1" min="1" value="<?php echo esc_attr( ifset( $geodata['venue_radius'], '' ) ); ?>" /> 78 83 </label> 84 <label for="venue_url" class="quarter"> 85 <?php esc_html_e( 'Venue URL:', 'simple-location' ); ?> 86 <input class="widefat" type="url" name="venue_url" id="venue_url" value="<?php echo esc_attr( ifset( $geodata['venue_url'], '' ) ); ?>" /> 87 </label> 88 79 89 <?php } else { ?> 80 90 <label for="venue_id" class="quarter"> … … 88 98 'option_none_value' => '', 89 99 'hierarchical' => true, 90 'post_type' => 'venue' 100 'post_type' => 'venue', 101 'selected' => ifset( $geodata['venue_id'] ) 91 102 ) 92 103 ); ?> -
simple-location/trunk/includes/class-geo-base.php
r2974027 r3008945 1130 1130 delete_post_meta( $post_id, 'venue_id' ); 1131 1131 } 1132 } elseif ( isset( $_POST['venue_radius'] ) && is_numeric( $_POST['venue_radius'] ) ) { 1132 } else { 1133 if ( isset( $_POST['venue_radius'] ) && is_numeric( $_POST['venue_radius'] ) ) { 1133 1134 update_post_meta( $post_id, 'venue_radius', intval( $_POST['venue_radius'] ) ); 1134 } else { 1135 delete_post_meta( $post_id, 'venue_radius' ); 1135 } else { 1136 delete_post_meta( $post_id, 'venue_radius' ); 1137 } 1138 if ( isset( $_POST['venue_url'] ) ) { 1139 update_post_meta( $post_id, 'venue_url', sanitize_url( $_POST['venue_url'] ) ); 1140 } else { 1141 delete_post_meta( $post_id, 'venue_url' ); 1142 } 1143 1136 1144 } 1137 1145 self::save_meta( 'post', $post_id ); -
simple-location/trunk/includes/class-location-plugins.php
r2974027 r3008945 152 152 $meta = $args['meta_input']; 153 153 154 // If there are no location based properties then exit this. 155 if ( ! isset( $properties['checkin'] ) && ! isset( $properties['location'] ) && ! isset( $properties['latitude'] ) && ! isset( $properties['longitude'] ) && ! isset( $meta['geo_latitude'] ) && ! isset( $meta['geo_longitude'] ) ) { 156 return; 157 } 158 159 if ( isset( $properties['published'] ) ) { 160 $published = new DateTime( $properties['published'][0] ); 161 } else { 162 $published = new DateTime( 'now', wp_timezone() ); 163 } 164 154 165 if ( isset( $meta['geo_longitude'] ) && $meta['geo_latitude'] ) { 155 if ( isset( $properties['published'] ) ) {156 $published = new DateTime( $properties['published'][0] );157 } else {158 $published = new DateTime();159 }160 166 // Always assume a checkin is to a building level option 161 167 if ( isset( $properties['checkin'] ) ) { … … 194 200 } 195 201 196 // If there are no location based properties then exit this.197 if ( ! isset( $properties['checkin'] ) && ! isset( $properties['location'] ) && ! isset( $properties['latitude'] ) && ! isset( $properties['longitude'] ) ) {198 return;199 }200 202 201 203 if ( isset( $properties['location'] ) && ! wp_is_numeric_array( $properties['location'] ) ) { -
simple-location/trunk/readme.txt
r2994608 r3008945 4 4 Requires at least: 4.9 5 5 Tested up to: 6.4 6 Stable tag: 5.0.1 86 Stable tag: 5.0.19 7 7 Requires PHP: 5.6 8 8 License: GPLv2 or later … … 288 288 289 289 == Changelog == 290 291 = 5.0.19 ( 2023-12-12 ) = 292 * Pulldown will set option by default 293 * Fix micropub integration to add additional check 290 294 291 295 = 5.0.18 ( 2023-11-11 ) = -
simple-location/trunk/simple-location.php
r2994608 r3008945 4 4 * Plugin URI: https://wordpress.org/plugins/simple-location/ 5 5 * Description: Adds Location to WordPress 6 * Version: 5.0.1 86 * Version: 5.0.19 7 7 * Requires at least: 4.9 8 8 * Requires PHP: 7.0 -
simple-location/trunk/templates/loc-metabox.php
r2994608 r3008945 15 15 if ( 'venue' === $type ) { 16 16 $geodata['venue_radius'] = get_post_meta( get_the_ID(), 'venue_radius', true ); 17 $geodata['venue_url'] = get_post_meta( get_the_ID(), 'venue_url', true ); 17 18 } else { 18 19 $geodata['venue_id'] = get_post_meta( get_the_ID(), 'venue_id', true ); … … 23 24 $location = wp_get_object_terms( get_the_ID(), 'location', array( 'fields' => 'ids' ) ); 24 25 $location = count( $location ) >= 1 ? $location[0] : ''; 25 $display_name = ifset( $geodata['address'] ); 26 if ( array_key_exists( 'venue_id', $geodata ) && $geodata['venue_id'] ) { 27 $display_name = get_the_title( $geodata['venue_id'] ); 28 } else { 29 $display_name = ifset( $geodata['address'] ); 30 } 26 31 27 32 $public = array_key_exists( 'visibility', $geodata ) ? $geodata['visibility'] : get_option( 'geo_public' ); … … 77 82 <input class="widefat" type="number" name="venue_radius" id="venue_radius" step="1" min="1" value="<?php echo esc_attr( ifset( $geodata['venue_radius'], '' ) ); ?>" /> 78 83 </label> 84 <label for="venue_url" class="quarter"> 85 <?php esc_html_e( 'Venue URL:', 'simple-location' ); ?> 86 <input class="widefat" type="url" name="venue_url" id="venue_url" value="<?php echo esc_attr( ifset( $geodata['venue_url'], '' ) ); ?>" /> 87 </label> 88 79 89 <?php } else { ?> 80 90 <label for="venue_id" class="quarter"> … … 88 98 'option_none_value' => '', 89 99 'hierarchical' => true, 90 'post_type' => 'venue' 100 'post_type' => 'venue', 101 'selected' => ifset( $geodata['venue_id'] ) 91 102 ) 92 103 ); ?>
Note: See TracChangeset
for help on using the changeset viewer.