Skip to content

Commit 9a1fe03

Browse files
authored
fix(wp5.9): taxonomy panel filter (#149)
* fix(wp5.9): taxonomy panel filter no longer includes taxonomy data in filtered props * fix: add missing CHANGELOG.md file * chore: update outdated translators note
1 parent 1ed4256 commit 9a1fe03

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

CHANGELOG.md

Whitespace-only changes.

src/editor/taxonomy-panel/index.js

+9-5
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,22 @@ export const TaxonomyPanel = PostTaxonomies => {
2020
return <PostTaxonomies { ...props } />;
2121
}
2222

23-
const { slug, taxonomy } = props;
24-
const { hierarchical, labels } = taxonomy;
23+
const { slug } = props;
24+
const hierarchical = 'category' === slug;
25+
const label =
26+
'category' === slug
27+
? __( 'categories', 'newspack-sponsors' )
28+
: __( 'tags', 'newspack-sponsors' );
2529
const message = sprintf(
2630
// Translators: explanation for applying sponsors to a taxonomy term.
2731
__(
2832
'%1$s one or more post %2$s to associate this sponsor with those %3$s.',
2933
'newspack-sponsors'
3034
),
31-
// Translators: "Select" terms if none added yet, or "Add" terms if there's at least one selected already.
35+
// Translators: "Select" terms if the taxonomy is hierarchical, or "Add" terms if not.
3236
hierarchical ? __( 'Select ', 'newspack-sponsors' ) : __( 'Add ', 'newspack-sponsors' ),
33-
labels.name.toLowerCase(),
34-
labels.name.toLowerCase()
37+
label,
38+
label
3539
);
3640

3741
return (

0 commit comments

Comments
 (0)