From 0c203c375cf13c76ba3422da54cb0f1b46433a84 Mon Sep 17 00:00:00 2001 From: Dennis Elsinga Date: Mon, 7 Aug 2023 10:41:20 +0200 Subject: [PATCH] Changed endpoint to new `v3` URL --- pronamic-maps.php | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/pronamic-maps.php b/pronamic-maps.php index 31ba949..0ea9a5e 100644 --- a/pronamic-maps.php +++ b/pronamic-maps.php @@ -2,7 +2,7 @@ /** * Plugin Name: Pronamic Maps * Plugin URI: https://www.pronamic.eu/plugins/pronamic-maps/ - * Description: + * Description: * * Version: 1.0.1 * Requires at least: 4.7 @@ -14,7 +14,7 @@ * Domain Path: /languages/ * * License: GPL-3.0-or-later - * + * * Update URI: https://www.pronamic.eu/plugins/pronamic-maps/ * GitHub URI: https://github.com/pronamic/wp-pronamic-maps * @@ -53,7 +53,7 @@ function () { 'permission_callback' => array( $this, 'permission_callback_same_origin' ), 'args' => array( /** - * A cache-buster is a unique string which is appended to a URL + * A cache-buster is a unique string which is appended to a URL * in the form of a query string. * * Google Tag Managers uses the `gtmcb` parameter as default. @@ -70,7 +70,7 @@ function () { 'type' => 'string', ), ), - ) + ) ); \register_rest_route( @@ -105,7 +105,7 @@ function () { $address = $this->complete_address_via_dutch_pdok( $address ); $address = $this->complete_address_via_belgium_local( $address ); $address = $this->complete_address_via_google( $address ); - + return (object) array( 'address' => $address, ); @@ -129,9 +129,9 @@ function () { 'type' => 'string', ), ), - ) + ) ); - } + } ); \add_action( 'admin_init', array( $this, 'admin_init' ) ); @@ -179,8 +179,8 @@ public function admin_menu() { \add_options_page( __( 'Pronamic Maps', 'pronamic-maps' ), __( 'Pronamic Maps', 'pronamic-maps' ), - 'manage_options', - 'pronamic_maps_settings', + 'manage_options', + 'pronamic_maps_settings', array( $this, 'page_settings' ) ); } @@ -206,7 +206,7 @@ public function page_settings() { /** * Field text. - * + * * @param array $args Arguments. */ public function field_input_text( $args ) { @@ -319,7 +319,7 @@ public function rest_api_location_self( WP_REST_Request $request ) { /** * Complete address via locale. - * + * * @param object $address Address to complete. * @return object */ @@ -337,7 +337,7 @@ public function complete_address_via_locale( $address ) { /** * Complete address via Gravity Forms. - * + * * @param object $address Address to complete. * @return object */ @@ -361,7 +361,7 @@ public function complete_address_via_gravityforms( $address ) { /** * Complete address via Dutch PDOK. - * + * * @link https://geodata.nationaalgeoregister.nl/ * @param object $address Address to complete. * @return object @@ -372,7 +372,7 @@ public function complete_address_via_dutch_pdok( $address ) { } // Suggest request. - $url = 'https://geodata.nationaalgeoregister.nl/locatieserver/v3/free'; + $url = 'https://api.pdok.nl/bzk/locatieserver/search/v3_1/free'; $url = \add_query_arg( array( @@ -416,7 +416,7 @@ public function complete_address_via_dutch_pdok( $address ) { /** * Complete address via Belgium local postal codes data. - * + * * @link https://www.bpost2.be/zipcodes/files/zipcodes_num_nl_new.html * @param object $address Address to complete. * @return object @@ -445,7 +445,7 @@ public function complete_address_via_belgium_local( $address ) { /** * Complete address via Google. - * + * * @param object $address Address to complete. * @return object */ @@ -487,7 +487,7 @@ public function complete_address_via_google( $address ) { foreach ( $item->address_components as $component ) { /** * Component `locality` indicates an incorporated city or town political entity. - * + * * @link https://developers.google.com/maps/documentation/geocoding/overview */ if ( \in_array( 'locality', $component->types ) ) { @@ -530,7 +530,7 @@ public function gform_field_advanced_settings( $position, $form_id ) { - + setAttribute( 'tabindex', '-1' );