Plugin Directory

Changeset 3008945


Ignore:
Timestamp:
12/12/2023 05:29:16 PM (2 years ago)
Author:
dshanske
Message:

Update to version 5.0.19 from GitHub

Location:
simple-location
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • simple-location/tags/5.0.19/includes/class-geo-base.php

    r2974027 r3008945  
    11301130                delete_post_meta( $post_id, 'venue_id' );
    11311131            }
    1132         } elseif ( isset( $_POST['venue_radius'] ) && is_numeric( $_POST['venue_radius'] ) ) {
     1132        } else {
     1133            if ( isset( $_POST['venue_radius'] ) && is_numeric( $_POST['venue_radius'] ) ) {
    11331134                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
    11361144        }
    11371145        self::save_meta( 'post', $post_id );
  • simple-location/tags/5.0.19/includes/class-location-plugins.php

    r2974027 r3008945  
    152152        $meta       = $args['meta_input'];
    153153
     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
    154165        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             }
    160166            // Always assume a checkin is to a building level option
    161167            if ( isset( $properties['checkin'] ) ) {
     
    194200        }
    195201
    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         }
    200202
    201203        if ( isset( $properties['location'] ) && ! wp_is_numeric_array( $properties['location'] ) ) {
  • simple-location/tags/5.0.19/readme.txt

    r2994608 r3008945  
    44Requires at least: 4.9
    55Tested up to: 6.4
    6 Stable tag: 5.0.18
     6Stable tag: 5.0.19
    77Requires PHP: 5.6
    88License: GPLv2 or later
     
    288288
    289289== Changelog ==
     290
     291= 5.0.19 ( 2023-12-12 ) =
     292* Pulldown will set option by default
     293* Fix micropub integration to add additional check
    290294
    291295= 5.0.18 ( 2023-11-11 ) =
  • simple-location/tags/5.0.19/simple-location.php

    r2994608 r3008945  
    44 * Plugin URI: https://wordpress.org/plugins/simple-location/
    55 * Description: Adds Location to WordPress
    6  * Version: 5.0.18
     6 * Version: 5.0.19
    77 * Requires at least: 4.9
    88 * Requires PHP: 7.0
  • simple-location/tags/5.0.19/templates/loc-metabox.php

    r2994608 r3008945  
    1515    if ( 'venue' === $type ) {
    1616        $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 );
    1718    } else {
    1819        $geodata['venue_id'] = get_post_meta( get_the_ID(), 'venue_id', true );
     
    2324$location     = wp_get_object_terms( get_the_ID(), 'location', array( 'fields' => 'ids' ) );
    2425$location     = count( $location ) >= 1 ? $location[0] : '';
    25 $display_name = ifset( $geodata['address'] );
     26if ( 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}
    2631
    2732$public     = array_key_exists( 'visibility', $geodata ) ? $geodata['visibility'] : get_option( 'geo_public' );
     
    7782            <input class="widefat" type="number" name="venue_radius" id="venue_radius" step="1" min="1" value="<?php echo esc_attr( ifset( $geodata['venue_radius'], '' ) ); ?>" />
    7883        </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
    7989    <?php } else { ?>
    8090        <label for="venue_id" class="quarter">
     
    8898                    'option_none_value' => '',
    8999                    'hierarchical' => true,
    90                     'post_type' => 'venue'
     100                    'post_type' => 'venue',
     101                    'selected' => ifset( $geodata['venue_id'] )
    91102                )
    92103            ); ?>
  • simple-location/trunk/includes/class-geo-base.php

    r2974027 r3008945  
    11301130                delete_post_meta( $post_id, 'venue_id' );
    11311131            }
    1132         } elseif ( isset( $_POST['venue_radius'] ) && is_numeric( $_POST['venue_radius'] ) ) {
     1132        } else {
     1133            if ( isset( $_POST['venue_radius'] ) && is_numeric( $_POST['venue_radius'] ) ) {
    11331134                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
    11361144        }
    11371145        self::save_meta( 'post', $post_id );
  • simple-location/trunk/includes/class-location-plugins.php

    r2974027 r3008945  
    152152        $meta       = $args['meta_input'];
    153153
     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
    154165        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             }
    160166            // Always assume a checkin is to a building level option
    161167            if ( isset( $properties['checkin'] ) ) {
     
    194200        }
    195201
    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         }
    200202
    201203        if ( isset( $properties['location'] ) && ! wp_is_numeric_array( $properties['location'] ) ) {
  • simple-location/trunk/readme.txt

    r2994608 r3008945  
    44Requires at least: 4.9
    55Tested up to: 6.4
    6 Stable tag: 5.0.18
     6Stable tag: 5.0.19
    77Requires PHP: 5.6
    88License: GPLv2 or later
     
    288288
    289289== Changelog ==
     290
     291= 5.0.19 ( 2023-12-12 ) =
     292* Pulldown will set option by default
     293* Fix micropub integration to add additional check
    290294
    291295= 5.0.18 ( 2023-11-11 ) =
  • simple-location/trunk/simple-location.php

    r2994608 r3008945  
    44 * Plugin URI: https://wordpress.org/plugins/simple-location/
    55 * Description: Adds Location to WordPress
    6  * Version: 5.0.18
     6 * Version: 5.0.19
    77 * Requires at least: 4.9
    88 * Requires PHP: 7.0
  • simple-location/trunk/templates/loc-metabox.php

    r2994608 r3008945  
    1515    if ( 'venue' === $type ) {
    1616        $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 );
    1718    } else {
    1819        $geodata['venue_id'] = get_post_meta( get_the_ID(), 'venue_id', true );
     
    2324$location     = wp_get_object_terms( get_the_ID(), 'location', array( 'fields' => 'ids' ) );
    2425$location     = count( $location ) >= 1 ? $location[0] : '';
    25 $display_name = ifset( $geodata['address'] );
     26if ( 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}
    2631
    2732$public     = array_key_exists( 'visibility', $geodata ) ? $geodata['visibility'] : get_option( 'geo_public' );
     
    7782            <input class="widefat" type="number" name="venue_radius" id="venue_radius" step="1" min="1" value="<?php echo esc_attr( ifset( $geodata['venue_radius'], '' ) ); ?>" />
    7883        </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
    7989    <?php } else { ?>
    8090        <label for="venue_id" class="quarter">
     
    8898                    'option_none_value' => '',
    8999                    'hierarchical' => true,
    90                     'post_type' => 'venue'
     100                    'post_type' => 'venue',
     101                    'selected' => ifset( $geodata['venue_id'] )
    91102                )
    92103            ); ?>
Note: See TracChangeset for help on using the changeset viewer.