diff --git a/includes/class-geo-base.php b/includes/class-geo-base.php index 213cd2b..3ccc59d 100644 --- a/includes/class-geo-base.php +++ b/includes/class-geo-base.php @@ -54,7 +54,6 @@ public static function init() { add_action( 'restrict_manage_posts', array( __CLASS__, 'geo_posts_dropdown' ), 12, 2 ); add_action( 'restrict_manage_comments', array( __CLASS__, 'geo_comments_dropdown' ), 12 ); - add_filter( 'bulk_actions-edit-post', array( __CLASS__, 'register_bulk_edit_location' ), 10 ); add_filter( 'handle_bulk_actions-edit-post', array( __CLASS__, 'handle_bulk_edit_location' ), 10, 3 ); add_action( 'admin_notices', array( __CLASS__, 'bulk_action_admin_notices' ) ); @@ -458,7 +457,7 @@ public static function geo_posts_dropdown( $post_type, $which ) { if ( ! post_type_supports( $post_type, 'geo-location' ) ) { return; } - $type = get_post_type_object( $post_type ); + $type = get_post_type_object( $post_type ); $selected = 'none'; if ( isset( $_REQUEST['geo'] ) ) { $selected = sanitize_text_field( $_REQUEST['geo'] ); @@ -1131,7 +1130,7 @@ public static function save_post_meta( $post_id ) { } else { delete_post_meta( $post_id, 'venue_id' ); } - } else { + } else { if ( isset( $_POST['venue_radius'] ) && is_numeric( $_POST['venue_radius'] ) ) { update_post_meta( $post_id, 'venue_radius', intval( $_POST['venue_radius'] ) ); } else { @@ -1142,7 +1141,6 @@ public static function save_post_meta( $post_id ) { } else { delete_post_meta( $post_id, 'venue_url' ); } - } self::save_meta( 'post', $post_id ); } diff --git a/includes/class-geo-data.php b/includes/class-geo-data.php index bee7f35..7152ae7 100644 --- a/includes/class-geo-data.php +++ b/includes/class-geo-data.php @@ -1019,7 +1019,7 @@ public static function get_location( $type, $id, $args = array() ) { if ( $term ) { Location_Taxonomy::set_location( $id, $term ); } - } + } } else { $term = false; $venue = false; diff --git a/includes/class-location-plugins.php b/includes/class-location-plugins.php index 5fff733..27f48bd 100755 --- a/includes/class-location-plugins.php +++ b/includes/class-location-plugins.php @@ -199,7 +199,6 @@ public static function micropub_set_location( $input, $args ) { } } - if ( isset( $properties['location'] ) && ! wp_is_numeric_array( $properties['location'] ) ) { $location = $properties['location']['properties']; if ( isset( $properties['checkin'] ) && ! wp_is_numeric_array( $properties['checkin'] ) ) { diff --git a/includes/class-location-taxonomy.php b/includes/class-location-taxonomy.php index 85bf514..75d6f64 100755 --- a/includes/class-location-taxonomy.php +++ b/includes/class-location-taxonomy.php @@ -91,21 +91,21 @@ public static function location_dropdown( $post_type, $which ) { if ( ! post_type_supports( $post_type, 'geo-location' ) ) { return; } - $type = get_post_type_object( $post_type ); + $type = get_post_type_object( $post_type ); $selected = ''; if ( isset( $_REQUEST['location'] ) ) { $selected = sanitize_text_field( $_REQUEST['location'] ); } - wp_dropdown_categories( + wp_dropdown_categories( array( - 'name' => 'location', - 'id' => 'location', - 'show_option_none' => $type->labels->all_items, + 'name' => 'location', + 'id' => 'location', + 'show_option_none' => $type->labels->all_items, 'option_none_value' => '', - 'hierarchical' => true, - 'taxonomy' => 'location', - 'value_field' => 'slug', - 'selected' => $selected + 'hierarchical' => true, + 'taxonomy' => 'location', + 'value_field' => 'slug', + 'selected' => $selected, ) ); } @@ -920,7 +920,6 @@ public static function get_post_location_link( $post_id = null ) { * Wrapper around wp_list_categories for now that outputs a list of the locations. * May be customized further in future. */ - public static function list_locations() { $defaults = array( 'taxonomy' => 'location', diff --git a/includes/class-post-venue.php b/includes/class-post-venue.php index 86756e8..9152c8e 100644 --- a/includes/class-post-venue.php +++ b/includes/class-post-venue.php @@ -361,7 +361,7 @@ public static function venue_types_dropdown( $post_type, $which ) { * * @param float $lat Latitude. * @param float $lng Longitude. - * @param int $radius Radius to Search In. Optional. + * @param int $radius Radius to Search In. Optional. * @return array Return the IDs of all nearby venues */ public static function nearby( $lat, $lng, $radius = 100 ) { diff --git a/includes/class-rest-geo.php b/includes/class-rest-geo.php index 7250c81..4e165e6 100644 --- a/includes/class-rest-geo.php +++ b/includes/class-rest-geo.php @@ -238,9 +238,9 @@ public function register_routes() { 'provider' => array( 'sanitize_callback' => 'sanitize_text_field', ), - 'select' => array( - 'sanitize_callback' => 'sanitize_text_field' - ) + 'select' => array( + 'sanitize_callback' => 'sanitize_text_field', + ), ), 'permission_callback' => function ( $request ) { return current_user_can( 'publish_posts' ); @@ -448,31 +448,31 @@ public static function user( $request ) { public static function venue( $request ) { // We dont need to check the nonce like with admin-ajax. $params = $request->get_params(); - $select = empty( $params['select'] ) ? null : $params['select']; + $select = empty( $params['select'] ) ? null : $params['select']; $provider = empty( $params['provider'] ) ? null : $params['provider']; $location = empty( $params['location'] ) ? null : $params['location']; if ( $select ) { $venue_args = array( - 'name' => 'venue_id', - 'id' => 'venue_id', - 'show_option_none' => __( 'No Venue', 'simple-location' ), + 'name' => 'venue_id', + 'id' => 'venue_id', + 'show_option_none' => __( 'No Venue', 'simple-location' ), 'option_none_value' => '0', - 'hierarchical' => true, - 'post_type' => 'venue', - 'echo' => false, + 'hierarchical' => true, + 'post_type' => 'venue', + 'echo' => false, ); if ( is_numeric( $location ) && $location > 0 ) { $venue_args['tax_query'] = array( array( 'taxonomy' => 'location', - 'terms' => $location, - ) + 'terms' => $location, + ), ); } - $response = wp_dropdown_pages( $venue_args ); + $response = wp_dropdown_pages( $venue_args ); if ( $response ) { return array( - 'venue_select' => $response + 'venue_select' => $response, ); } else { return $venue_args; diff --git a/includes/class-sloc-media-metadata.php b/includes/class-sloc-media-metadata.php index 07c441f..5cacfbb 100644 --- a/includes/class-sloc-media-metadata.php +++ b/includes/class-sloc-media-metadata.php @@ -225,7 +225,7 @@ public static function attachment( $meta, $post_id ) { $reverse->set( $data['location']['latitude'], $data['location']['longitude'] ); $reverse_adr = $reverse->reverse_lookup(); if ( ! is_wp_error( $reverse_adr ) ) { - $term = Location_Taxonomy::get_location( $reverse_adr, true ); + $term = Location_Taxonomy::get_location( $reverse_adr, true ); Location_Taxonomy::set_location( $post_id, $term ); if ( isset( $reverse_adr['display-name'] ) ) { $update['geo_address'] = $reverse_adr['display-name']; diff --git a/includes/data-functions.php b/includes/data-functions.php index bb443ca..8826b38 100644 --- a/includes/data-functions.php +++ b/includes/data-functions.php @@ -6,7 +6,6 @@ * * @package Simple_Location */ - function set_post_geodata( $post, $key, $geodata ) { $post = get_post( $post ); if ( ! $post ) { diff --git a/includes/geo/class-geo-provider-here.php b/includes/geo/class-geo-provider-here.php index fbcb53e..846f4f0 100644 --- a/includes/geo/class-geo-provider-here.php +++ b/includes/geo/class-geo-provider-here.php @@ -87,7 +87,7 @@ private function address_to_mf2( $json ) { 'houseNumber', ) ); - $street = self::ifnot( + $street = self::ifnot( $location, array( 'street', diff --git a/includes/widgets/class-sloc-airport-widget.php b/includes/widgets/class-sloc-airport-widget.php index a1683b4..6784e81 100755 --- a/includes/widgets/class-sloc-airport-widget.php +++ b/includes/widgets/class-sloc-airport-widget.php @@ -13,8 +13,8 @@ public function __construct() { 'Sloc_Airport_Widget', __( 'Airport Weather Station', 'simple-location' ), array( - 'description' => __( 'Adds current weather conditions at an airport', 'simple-location' ), - 'show_instance_in_rest' => true + 'description' => __( 'Adds current weather conditions at an airport', 'simple-location' ), + 'show_instance_in_rest' => true, ) ); } diff --git a/includes/widgets/class-sloc-lastseen-widget.php b/includes/widgets/class-sloc-lastseen-widget.php index ef0e59a..aeca5a6 100755 --- a/includes/widgets/class-sloc-lastseen-widget.php +++ b/includes/widgets/class-sloc-lastseen-widget.php @@ -13,8 +13,8 @@ public function __construct() { 'Sloc_Lastseen_Widget', __( 'User Last Seen', 'simple-location' ), array( - 'description' => __( 'Displays the location, time, or map of a users location.', 'simple-location' ), - 'show_instance_in_rest' => true + 'description' => __( 'Displays the location, time, or map of a users location.', 'simple-location' ), + 'show_instance_in_rest' => true, ) ); } diff --git a/includes/widgets/class-sloc-station-widget.php b/includes/widgets/class-sloc-station-widget.php index 1823aec..af1e315 100755 --- a/includes/widgets/class-sloc-station-widget.php +++ b/includes/widgets/class-sloc-station-widget.php @@ -13,8 +13,8 @@ public function __construct() { 'Sloc_Station_Widget', __( 'Weather Station', 'simple-location' ), array( - 'description' => __( 'Adds current weather conditions', 'simple-location' ), - 'show_instance_in_rest' => true + 'description' => __( 'Adds current weather conditions', 'simple-location' ), + 'show_instance_in_rest' => true, ) ); } diff --git a/includes/widgets/class-sloc-weather-widget.php b/includes/widgets/class-sloc-weather-widget.php index ebffed9..ea556f0 100755 --- a/includes/widgets/class-sloc-weather-widget.php +++ b/includes/widgets/class-sloc-weather-widget.php @@ -13,8 +13,8 @@ public function __construct() { 'Sloc_Weather_Widget', __( 'Weather', 'simple-location' ), array( - 'description' => __( 'Adds current weather conditions', 'simple-location' ), - 'show_instance_in_rest' => true + 'description' => __( 'Adds current weather conditions', 'simple-location' ), + 'show_instance_in_rest' => true, ) ); } diff --git a/templates/loc-metabox.php b/templates/loc-metabox.php index 154a707..632c1de 100644 --- a/templates/loc-metabox.php +++ b/templates/loc-metabox.php @@ -14,15 +14,15 @@ $geodata = get_post_geodata(); if ( 'venue' === $type ) { $geodata['venue_radius'] = get_post_meta( get_the_ID(), 'venue_radius', true ); - $geodata['venue_url'] = get_post_meta( get_the_ID(), 'venue_url', true ); + $geodata['venue_url'] = get_post_meta( get_the_ID(), 'venue_url', true ); } else { $geodata['venue_id'] = get_post_meta( get_the_ID(), 'venue_id', true ); } } -$location = wp_get_object_terms( get_the_ID(), 'location', array( 'fields' => 'ids' ) ); -$location = count( $location ) >= 1 ? $location[0] : ''; +$location = wp_get_object_terms( get_the_ID(), 'location', array( 'fields' => 'ids' ) ); +$location = count( $location ) >= 1 ? $location[0] : ''; if ( is_array( $geodata ) && array_key_exists( 'venue_id', $geodata ) && $geodata['venue_id'] ) { $display_name = get_the_title( $geodata['venue_id'] ); } else { @@ -90,25 +90,25 @@ diff --git a/templates/map-archive.php b/templates/map-archive.php index 9228df0..4f0d530 100644 --- a/templates/map-archive.php +++ b/templates/map-archive.php @@ -42,8 +42,8 @@ 'icon' => false, 'object_link' => true, 'altitude' => false, - 'text' => true, - 'description' => get_the_time( $date_format, get_the_ID() ) + 'text' => true, + 'description' => get_the_time( $date_format, get_the_ID() ), ) ); }