Add districts with zipcodes, so the REST API can be filtered using a …#20
Open
richardkorthuis wants to merge 3 commits intomasterfrom
Open
Add districts with zipcodes, so the REST API can be filtered using a …#20richardkorthuis wants to merge 3 commits intomasterfrom
richardkorthuis wants to merge 3 commits intomasterfrom
Conversation
mvdhoek1
approved these changes
Oct 30, 2023
Contributor
mvdhoek1
left a comment
There was a problem hiding this comment.
Vergeet niet om de version bumps toe te voegen aan Foundation/Plugin.php, openpub-base.php en aan de CHANGELOG.md
| ]; | ||
| } | ||
|
|
||
| public static function addZipcodeParameter(string $zipcode): array |
Contributor
There was a problem hiding this comment.
Eindigen met een happy path heeft mijn voorkeur:
public static function addZipcodeParameter(string $zipcode): array
{
global $wpdb;
$sql = "SELECT term_id FROM {$wpdb->termmeta} WHERE meta_key = '_owc_openpub_zipcode' AND meta_value = %s";
$results = $wpdb->get_col($wpdb->prepare($sql, (int)$zipcode));
if (! $results) {
return [];
}
return [
'tax_query' => [
[
'taxonomy' => 'openpub-district',
'terms' => $results,
'field' => 'term_id',
'operator' => 'IN'
]
]
];
}
Member
Author
There was a problem hiding this comment.
Dit heb ik aangepast.
# Conflicts: # languages/openpub-base-nl_NL.mo # languages/openpub-base-nl_NL.po # languages/openpub-base.pot # src/Base/RestAPI/Controllers/ItemController.php
Member
Author
Leek me logisch om dat pas te doen als de PR was gemerged, maar bij deze gedaan |
23a0d73 to
c20dfe4
Compare
mvdhoek1
approved these changes
Apr 29, 2024
Contributor
|
@robertbossaert kun jij nog even checken, anders kan er niet gemerged worden. |
|
|
||
| #: config/metaboxes.php:156 | ||
| msgid "A zipcode that is part of this district. (Only numbers, no letters)" | ||
| msgstr "Een postcode die bij deze wijk hoort. (Alleen cijfer, geen letters)" |
Member
There was a problem hiding this comment.
Kun je hier nog cijfers van maken
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…zipcode.