-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Block Library: Add features to the Post Tags block. #20418
Conversation
Size Change: +140 B (0%) Total Size: 865 kB
ℹ️ View Unchanged
|
$output .= '<a href="' . get_tag_link( $tag->term_id ) . '">' . $tag->name . '</a>' . ' | '; | ||
} | ||
return trim( $output, ' | ' ); | ||
$output = array_map( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it'd be feasible to use the_tags()
for rendering and just map the attributes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That echos the output, and we lose the ability to add more features in the future.
Wow, a Post Tags block! Nice work! I tested it out and have a bit of feedback. 1. Using the keyboard to navigate was difficult. 2. I enjoy editing the dividers in place. 3. The Before/After text was confusing. I wonder if removing the "After text." might be a good idea so that it helps diminish the cognitive discernment between what is editable and what's not. Maybe the "Before text." can be reworded to just say "Tags:" from the beginning? "Before text." appears to be more of a mistake here than any sort of help IMO. 4. No tags. 5. Hash tags. When I tried adding hashtags, I couldn't get it appended to the first tag. |
I thought the same. |
Can we surface them through a particular background color or something?
What's a better placeholder? Just
Should we support arbitrary prefixes, or is this limited enough in scope that we can make it a toggle/select thing? |
Should the default separator here be a comma instead of a pipe? I feel like that tends to be used more commonly. |
Agreed. "Tags" would make more sense and encourage interaction with the text.
I don't think the
A big +1 here. |
Agreed
Agreed, I was confused as to why it existed, to be honest.
Agreed |
@mtias Do you think these changes make sense? Do you see a use for the "after text"? |
@mtias, can you check this PR and let us know if this is something that should be continued or can be closed. It's outdated now. |
Closing this out due to lack of feedback. |
Description
This PR adds all the features of the tags theme function, https://codex.wordpress.org/Function_Reference/the_tags, to the Post Tags block as @mtias suggested in #19580 (comment).
How has this been tested?
It was verified that changing the before and after texts, and the separator, works as expected.
Screenshots
Types of Changes
New Feature: The Post Tags block now allows you to edit the before and after texts, and the separator.
Checklist: