Skip to content

Conversation

@richardkorthuis
Copy link
Member

…zipcode.

Copy link
Contributor

@mvdhoek1 mvdhoek1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'
				]
			]
		];
	}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@richardkorthuis
Copy link
Member Author

Vergeet niet om de version bumps toe te voegen aan Foundation/Plugin.php, openpub-base.php en aan de CHANGELOG.md

Leek me logisch om dat pas te doen als de PR was gemerged, maar bij deze gedaan

@mvdhoek1 mvdhoek1 force-pushed the feature/add-districts branch from 23a0d73 to c20dfe4 Compare April 29, 2024 14:08
@mvdhoek1 mvdhoek1 requested a review from robertbossaert April 29, 2024 14:09
@mvdhoek1
Copy link
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)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kun je hier nog cijfers van maken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants