-
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
Post Terms: Add wp_kses_post to prefix/suffix for consistency #40803
Conversation
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.
Thanks for the PR @andrewserong!
This doesn't hurt of course, but since we are not disabling the formats in the RichText instances used in edit
function, the formats are preserved and other html is treated as string
. I'm approving and leave this to you 😄
Size Change: +56 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
Thanks for the reviews, and the feedback @ntsekouras! I've added in While I was editing that file, I also added in I'll merge this in once tests pass. |
…create a paragraph block when hitting enter at the end of the Suffix field
11a979e
to
1e99fb6
Compare
What?
Following on from #40776 and #40559, this adds
wp_kses_post
to the Post Terms prefix and suffix fields.Also:
allowedFormats
to reduce the allowed formats for consistency with other blocks like Navigation Link (we probably only really need bold, italic, image, strikethrough rather than keyboard / super/subscript options) – I also added in link and text color, as they're probably still useful here.__unstableOnSplitAtEnd
to the suffix field so that if someone presses enter at the end of the suffix, it adds a Paragraph block instead of a newline character to the suffix field.Why?
This probably isn't really necessary, but for consistency with the other blocks that have RichText fields and server-render those fields, I thought we could add it in. (Happy to close this out if folks think it doesn't need it).
How?
Wrap the prefix and suffix in
wp_kses_post
Testing Instructions
On a post with tags attached, add a Post Tags block, and enter text in the prefix or suffix fields. Using the RichText controls, set some of the text to bold or italic and ensure it still renders correctly on the frontend.
Screenshots or screencast