Skip to content

Commit

Permalink
Merge pull request #13 from CodeWithDennis/main
Browse files Browse the repository at this point in the history
Changed endpoint to new `v3` URL
  • Loading branch information
kjtolsma authored Aug 8, 2023
2 parents ec4c27a + 0c203c3 commit 51d7ad6
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions pronamic-maps.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
*
Expand Down Expand Up @@ -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.
Expand All @@ -70,7 +70,7 @@ function () {
'type' => 'string',
),
),
)
)
);

\register_rest_route(
Expand Down Expand Up @@ -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,
);
Expand All @@ -129,9 +129,9 @@ function () {
'type' => 'string',
),
),
)
)
);
}
}
);

\add_action( 'admin_init', array( $this, 'admin_init' ) );
Expand Down Expand Up @@ -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' )
);
}
Expand All @@ -206,7 +206,7 @@ public function page_settings() {

/**
* Field text.
*
*
* @param array $args Arguments.
*/
public function field_input_text( $args ) {
Expand Down Expand Up @@ -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
*/
Expand All @@ -337,7 +337,7 @@ public function complete_address_via_locale( $address ) {

/**
* Complete address via Gravity Forms.
*
*
* @param object $address Address to complete.
* @return object
*/
Expand All @@ -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
Expand All @@ -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(
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -445,7 +445,7 @@ public function complete_address_via_belgium_local( $address ) {

/**
* Complete address via Google.
*
*
* @param object $address Address to complete.
* @return object
*/
Expand Down Expand Up @@ -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 ) ) {
Expand Down Expand Up @@ -530,7 +530,7 @@ public function gform_field_advanced_settings( $position, $form_id ) {
<input type="checkbox" id="field_pronamic_readonly" />

<label for="field_pronamic_readonly" class="inline"><?php esc_html_e( 'Readonly', 'pronamic-maps' ); ?></label>
</li>
</li>
<?php
}

Expand All @@ -555,7 +555,7 @@ public function gform_editor_js() {

jQuery( document ).on( 'gform_load_field_settings', function( event, field, form ) {
for ( const property in map ) {
jQuery( map[ property ] ).prop( 'checked', !! field[ property ] );
jQuery( map[ property ] ).prop( 'checked', !! field[ property ] );
}
} );

Expand All @@ -572,7 +572,7 @@ public function gform_editor_js() {

/**
* Gravity Forms field container.
*
*
* @link https://docs.gravityforms.com/gform_field_container/
* @param string $field_container Field container.
* @param object $field The field currently being processed.
Expand All @@ -597,7 +597,7 @@ public function gform_field_container( $field_container, $field ) {

/**
* Gravity Forms field content.
*
*
* @link https://github.com/wp-premium/gravityforms/blob/a9c8f2de051e016e096069210ecd5fb8f5a19801/form_display.php#L3397
* @param string $field_content Field content.
* @param \GF_Field $field Field.
Expand Down Expand Up @@ -639,7 +639,7 @@ public function gform_field_content( $field_content, $field ) {
/**
* Set `tabindex` to `-1`, no need to make element reachable
* via sequential keyboard navigation.
*
*
* @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
*/
$input->setAttribute( 'tabindex', '-1' );
Expand Down

0 comments on commit 51d7ad6

Please sign in to comment.