Skip to content

Commit

Permalink
fix(wp5.9): taxonomy panel filter (#149)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
dkoo authored Jan 12, 2022
1 parent 1ed4256 commit 9a1fe03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Empty file added CHANGELOG.md
Empty file.
14 changes: 9 additions & 5 deletions src/editor/taxonomy-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,22 @@ export const TaxonomyPanel = PostTaxonomies => {
return <PostTaxonomies { ...props } />;
}

const { slug, taxonomy } = props;
const { hierarchical, labels } = taxonomy;
const { slug } = props;
const hierarchical = 'category' === slug;
const label =
'category' === slug
? __( 'categories', 'newspack-sponsors' )
: __( 'tags', 'newspack-sponsors' );
const message = sprintf(
// Translators: explanation for applying sponsors to a taxonomy term.
__(
'%1$s one or more post %2$s to associate this sponsor with those %3$s.',
'newspack-sponsors'
),
// Translators: "Select" terms if none added yet, or "Add" terms if there's at least one selected already.
// Translators: "Select" terms if the taxonomy is hierarchical, or "Add" terms if not.
hierarchical ? __( 'Select ', 'newspack-sponsors' ) : __( 'Add ', 'newspack-sponsors' ),
labels.name.toLowerCase(),
labels.name.toLowerCase()
label,
label
);

return (
Expand Down

0 comments on commit 9a1fe03

Please sign in to comment.