Skip to content

Commit 9352a39

Browse files
Add employment type to JobPosting taxonomies and add filter for injecting custom taxonomies from schema prop
1 parent 85799bf commit 9352a39

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@
8282
"helsingborg-stad/component-library": "Required for theme to work properly.",
8383
"helsingborg-stad/kirki": "Required for theme to work properly."
8484
},
85-
"version": "2.168.29"
85+
"version": "5.173.14"
8686
}

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

library/SchemaData/Taxonomy/TaxonomiesFromSchemaType/TaxonomiesFromSchemaType.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,19 @@ public function __construct(
3434
* @return array An array of TaxonomyInterface objects.
3535
*/
3636
public function create(string $schemaType): array
37-
{
38-
return [
37+
{
38+
$map = [
3939
'JobPosting' => $this->getJobPostingTaxonomies(),
4040
'Event' => $this->getEventTaxonomies(),
4141
'Project' => $this->getProjectTaxonomies(),
4242
'ExhibitionEvent' => $this->getExhibitionEventTaxonomies(),
4343
'ElementarySchool' => $this->getElementarySchoolTaxonomies(),
4444
'Preschool' => $this->getPreschoolTaxonomies(),
45-
][$schemaType] ?? [];
45+
];
46+
47+
$taxonomies = \apply_filters('Municipio/Schema/Taxonomy/' . $schemaType, $map[$schemaType] ?? [], $schemaType, $this->taxonomyFactory, $this->schemaToPostTypeResolver);
48+
49+
return $taxonomies;
4650
}
4751

4852
/**
@@ -73,6 +77,7 @@ private function getJobPostingTaxonomies(): array
7377
return [
7478
$this->createTaxonomy('JobPosting', 'relevantOccupation', $this->wpService->__('Job Categories', 'municipio'), $this->wpService->__('Job Category', 'municipio')),
7579
$this->createTaxonomy('JobPosting', 'validThrough', $this->wpService->__('Latest Application Dates', 'municipio'), $this->wpService->__('Latest Application Date', 'municipio')),
80+
$this->createTaxonomy('JobPosting', 'employmentType', $this->wpService->__('Employment Types', 'municipio'), $this->wpService->__('Employment Type', 'municipio')),
7681
];
7782
}
7883

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@helsingborg-stad/municipio",
3-
"version": "2.168.29",
3+
"version": "5.173.14",
44
"description": "The official wordpress theme of Helsingborg Stad",
55
"scripts": {
66
"test": "jest --coverage --maxWorkers=$(node -e \"console.log(Math.max(1, Math.floor(require('os').cpus().length / 2)))\")",

0 commit comments

Comments
 (0)