-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 a Post Tags block. #19580
Conversation
<a key={ tagId } href={ tag.link }> | ||
{ tag.name } | ||
</a> | ||
); |
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.
I believe ultimately, we could offer a way to add/remove tags directly here. Let's land a readonly block first though.
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.
Yes
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.
Added "design feedback" tag for designers to start thinking about the potential of these blocks (style variations, styling...)
|
||
export default function PostTagsEdit() { | ||
if ( ! useEntityId( 'postType', 'post' ) ) { | ||
return 'Post Tags Placeholder'; |
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.
i18n?
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.
Fixed.
It won't render anything. |
High level thought: should the block be called |
That makes more sense now that we have variations. |
Can we merge this scaffold to avoid more merge conflicts in the shared files? |
f4d9750
to
abc53bc
Compare
Rebased. |
Size Change: +222 B (0%) Total Size: 864 kB
ℹ️ View Unchanged
|
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.
Left a few minor notes and one question, but overall good to merge 👍
if ( ! empty( $post_tags ) ) { | ||
$output = ''; | ||
foreach ( $post_tags as $tag ) { | ||
$output .= '<a href="' . get_tag_link( $tag->term_id ) . '">' . $tag->name . '</a>' . ' | '; |
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.
We should get to a point where we support the common customization the theme function tags offer: https://codex.wordpress.org/Function_Reference/the_tags
Description
This PR adds a new Post Tags block akin to the Post Title and Post Content blocks.
How has this been tested?
Types of Changes
New Feature: There is a new Post Tags block for template building.
Checklist: