Skip to content

Update/post term add toggle for no terms message#55680

Open
n2erjo00 wants to merge 3 commits intoWordPress:trunkfrom
n2erjo00:update/post-term-add-toggle-for-no-terms-message
Open

Update/post term add toggle for no terms message#55680
n2erjo00 wants to merge 3 commits intoWordPress:trunkfrom
n2erjo00:update/post-term-add-toggle-for-no-terms-message

Conversation

@n2erjo00
Copy link
Copy Markdown
Contributor

Closes #55527

What?

This PR adds new block property to "Tags" block.
This property allows editors to control whether they want to show/hide "No tags" message from public side.

Why?

There was no control previously for this and editor would show this "No tags" message on the editor and nothing on public side.

How?

Added new block property for "Tags" block, created ToggleControl to allow editor to change state of that property and used that property on PHP render function.

Testing Instructions

  1. Open a post and give it some categories and tags
  2. Open a another post and make sure it has no categories and tags
  3. Open page and insert "Query loop" to page. Make sure "Tags" block is being used on inside the loop
  4. First post show render categories and tags normally
  5. Second post should show "No tags" (or "No categories")
  6. Go to editor and uncheck the new block property (See screenshot attached)
  7. Go to public side and note that where "No tags" was show now there is nothing.

Testing Instructions for Keyboard

Screenshots or screencast

Screenshot 2023-10-28 at 14 08 35

@n2erjo00 n2erjo00 requested a review from ajitbohra as a code owner October 28, 2023 11:18
@carolinan carolinan added [Type] Enhancement A suggestion for improvement. [Block] Post Terms Affects the Post Terms Block labels Oct 30, 2023
Copy link
Copy Markdown
Contributor

@carolinan carolinan left a comment

Choose a reason for hiding this comment

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

The text in the new option is not suitable for all taxonomies, since it mentions "tags".
English is not my first language, but there are some grammatical errors.

@n2erjo00
Copy link
Copy Markdown
Contributor Author

@carolinan I am famously bad at coming up with labels and even worse at coming up with help texts 😅 (Not native English speaker either)

Can we brainstorm suitable texts or altervative solution

If the main problem is word "tags" maybe we could abstract it somehow. For example replace "No tags" with "No results"

PS I totally forgot to use ChatGPT to check my grammar

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

Labels

[Block] Post Terms Affects the Post Terms Block [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tags / Categories: Include option show "No tags" message on website

2 participants