Plugin Directory

Changeset 1746651


Ignore:
Timestamp:
10/15/2017 09:57:49 AM (8 years ago)
Author:
svrooij
Message:

Committing 0.0.5 to trunk

Location:
geocoded-posts/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • geocoded-posts/trunk/geocoded-posts.php

    r1657008 r1746651  
    1111 * Plugin URI:          https://github.com/svrooij/wp-geocoded-posts
    1212 * Description:         Widget with geocoded posts and editing geo location on a post.
    13  * Version:             0.0.4
     13 * Version:             0.0.5
    1414 * Author:              Stephan van Rooij
    1515 * Author URI:          https://svrooij.nl
  • geocoded-posts/trunk/includes/class-geocoded-posts-editor.php

    r1657008 r1746651  
    119119
    120120    // Update the meta field in the database.
    121     update_post_meta( $post_id, 'geo_locality', strip_tags($_POST['geocoded_posts_locality']));
     121    if(!empty($_POST['geocoded_posts_locality'])){
     122      update_post_meta( $post_id, 'geo_locality', strip_tags($_POST['geocoded_posts_locality']));
     123    }
    122124    update_post_meta( $post_id, 'geo_latitude', $latitude );
    123125    update_post_meta( $post_id, 'geo_longitude', $longitude );
     126   
     127    // Who would want to add a location and not set it to public...??
     128    if(0==$public && !get_post_meta($post_id,'geo_public',true)){
     129      $public = 1;
     130    }
    124131    update_post_meta( $post_id, 'geo_public', $public );
    125132  }
  • geocoded-posts/trunk/includes/class-geocoded-posts-geocoder.php

    r1657008 r1746651  
    108108      $fetched_locality = $localityObjs[$right_key]->formatted_address;
    109109      update_post_meta($post_id, 'geo_locality', $fetched_locality);
     110
     111      // Set the location to public, the Wordpress App doesn't do this when connected through wordpress.com
     112      add_post_meta($post_id,'geo_public',1);
     113
    110114    } catch(Exception $e){
    111115      if(WP_DEBUG){
  • geocoded-posts/trunk/readme.txt

    r1657008 r1746651  
    44Tags: geocode, location, metadata
    55Requires at least: 4.4
    6 Tested up to: 4.7.4
    7 Stable tag: 0.0.4
     6Tested up to: 4.8.2
     7Stable tag: 0.0.5
    88License: MIT
    99License URI: https://raw.githubusercontent.com/svrooij/wp-geocoded-posts/master/LICENSE
     
    2121- Showing a widget with the latest x (configurable number) posts that have a geolocation.
    2222- Automatically looking up the locality of a new post.
    23 - Exposing a 'geo' object for each post in the REST api with 'latitude', 'longitude' and 'locality'
     23- Exposing a 'geo' object for each post in the REST api with 'latitude', 'longitude' and 'locality'.
     24- Posts from the mobile app connected through wordpress.com get the geo_public set automatically.
    2425
    2526Things that are on my wish list are:
    2627
    27 - Manually bulk geocoding old posts
     28- Manually bulk geocoding old posts.
    2829- Make the widget work with the api, so it will work with static html.
    2930- Displaying the geocoded posts on a map with a shortcode or something.
     
    4546== Changelog ==
    4647
     48= 0.0.5 =
     49* Setting 'geo_public' to 1 when a post comes in through wordpress.com
     50* If you add a location it is set to public by default.
     51
    4752= 0.0.4 =
    4853* Automatically create (and restore) backup location, in case the mobile app updates the location to 0,0.
Note: See TracChangeset for help on using the changeset viewer.