Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wp5.9): taxonomy panel filter #149

Merged
merged 3 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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