Preserve target="_blank" in Biographical Info and Category Description#7792
Preserve target="_blank" in Biographical Info and Category Description#7792Sukhendu2002 wants to merge 4 commits intoWordPress:trunkfrom
target="_blank" in Biographical Info and Category Description#7792Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
I just checked the implementation and tests LGTM 🎉 |
martinkrcho
left a comment
There was a problem hiding this comment.
It would be great to use data providers for the new tests.
https://phpunit.de/manual/3.7/en/appendixes.annotations.html#appendixes.annotations.dataProvider
The new test methods do very similar thing in each of them.
|
@martinkrcho, Thanks for the suggestion! I’ve updated the tests to use data providers accordingly. |
|
committed in https://core.trac.wordpress.org/changeset/59677 |
Preserve
target="_blank"in Biographical Info and Category DescriptionDescription
This pull request ensures that the
target="_blank"attribute is preserved when adding links in the Biographical Info and Category Description fields. Previously, this attribute was being stripped by the kses sanitization process.Additionally, new unit tests have been added to verify the preservation of the
target="_blank"attribute in these specific contexts.Changes Made
targetattribute to the allowed tags in theuser_descriptionandpre_term_descriptioncontexts inwp_kses_allowed_html().test_target_attribute_preserved_in_user_description()test_target_attribute_preserved_in_term_description()test_target_attribute_preserved_in_user_description_with_other_attributes()test_target_attribute_preserved_in_term_description_with_other_attributes()Trac ticket: https://core.trac.wordpress.org/ticket/12056