Skip to content

Commit

Permalink
bumb version 1.0.20
Browse files Browse the repository at this point in the history
  • Loading branch information
EliasKau committed Sep 12, 2023
1 parent 9b90d94 commit d084b14
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 1.0.20: 2023-09-12
## Added
* Added nonce to allow usage of logged in user during rest api calls.

### 1.0.19: 2023-02-24
## Added
* Set focus to search text field if url has a parameter with its name
Expand Down
Empty file modified README.md
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions air-search.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function enqueue_scripts() {
'disable_checkbox_auto_search' => apply_filters( 'air_search_disable_checkbox_auto_search', false ),
'disable_select_auto_search' => apply_filters( 'air_search_disable_select_auto_search', false ),
'search_on_empty' => wp_json_encode( get_location_search_on_empty_setting() ),
'nonce' => wp_create_nonce( 'wp_rest' ),
] );
} // end enqueue_scripts

Expand Down
2 changes: 1 addition & 1 deletion composer.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"plugin"
],
"license": "GPL-3.0+",
"version": "1.0.19",
"version": "1.0.20",
"authors": [
{
"name": "Digitoimisto Dude Oy",
Expand Down
Empty file modified helpers.php
100644 → 100755
Empty file.
Empty file modified index.php
100644 → 100755
Empty file.
Empty file modified phpcs.xml
100644 → 100755
Empty file.
Empty file modified query.php
100644 → 100755
Empty file.
9 changes: 8 additions & 1 deletion scripts.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,14 @@ function formSubmitEvent() {

async function callApi(searchText, location, args, searchFieldName = 's') {
const apiBase = 'air-search/v1/';
const res = await fetch(`${air_search_settings.rest_api_base}${apiBase + location}/${searchText}${args}`, { method: 'GET' });
const res = await fetch(`${air_search_settings.rest_api_base}${apiBase + location}/${searchText}${args}`, {
method: 'GET',
credentials: 'same-origin',
headers: new Headers({
'Content-Type': 'application/json',
'X-WP-Nonce': air_search_settings.nonce,
}),
});

let urlArgs = `${args}airloc=${location}`;
if (searchText) {
Expand Down
Empty file modified templates/air-search-item-default.php
100644 → 100755
Empty file.

0 comments on commit d084b14

Please sign in to comment.