Skip to content

"select" and "option" added to allowed HTML for settings.#2349

Merged
jasonbahl merged 2 commits intowp-graphql:developfrom
eavonius:develop
Apr 22, 2022
Merged

"select" and "option" added to allowed HTML for settings.#2349
jasonbahl merged 2 commits intowp-graphql:developfrom
eavonius:develop

Conversation

@eavonius
Copy link
Copy Markdown
Contributor

@eavonius eavonius commented Apr 22, 2022

What does this implement/fix? Explain your changes.

The get_allowed_wp_kses_html function was missing "select" and "option" which stripped the HTML when trying to add settings fields.

I noticed this when making an update I'm working on for the wpgraphql-cors repo which has its own tab of settings. Without this change, its not possible to create settings of the "select" type.

Does this close any currently open issues?

Any relevant logs, error output, GraphiQL screenshots, etc?

(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)

Any other comments?

Where has this been tested?

Operating System: Apache on php 7.4 in Docker

WordPress Version: 5.9

The get_allowed_wp_kses_html function was missing "select" and "option" which stripped the HTML when trying to add settings fields.

I noticed this when making an update I'm working on for the wpgraphql-cors repo which has its own tab of settings. Without this change, its not possible to create settings of the "select" type.
@jasonbahl
Copy link
Copy Markdown
Collaborator

Thanks @eavonius!

@jasonbahl jasonbahl self-requested a review April 22, 2022 17:59
@jasonbahl jasonbahl added object type: settings Relating to the Settings Types type: enhancement Improvements to existing functionality labels Apr 22, 2022
jasonbahl
jasonbahl previously approved these changes Apr 22, 2022
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 22, 2022

Coverage Status

Coverage decreased (-0.02%) to 79.256% when pulling c0b3ad2 on eavonius:develop into f7ebabb on wp-graphql:develop.

@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit c0b3ad2 and detected 0 issues on this pull request.

View more on Code Climate.

@jasonbahl jasonbahl merged commit a8170be into wp-graphql:develop Apr 22, 2022
jasonbahl added a commit that referenced this pull request Apr 22, 2022
Amendment to #2349 to add "selected" attribute to allowed HTML.
@jasonbahl jasonbahl mentioned this pull request May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

object type: settings Relating to the Settings Types type: enhancement Improvements to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants