Fix Persian/RTL characters display in Ability Explorer schemas#740
Merged
Conversation
Add JSON_UNESCAPED_UNICODE flag to wp_json_encode calls to properly display non-ASCII characters.
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
… we output the schema in a script block, since this doesn't pass through escaping functions
dkotter
approved these changes
Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Fixes the display of non‑ASCII characters (e.g., Persian, Arabic, Urdu) in the Ability Explorer schema viewer. Previously these characters were rendered as escaped unicode sequences such as \u0645\u062d\u062a\u0648\u0627.
Why?
When abilities include localized descriptions or examples in languages using non‑ASCII characters, the schema viewer becomes difficult to read because the JSON output escapes all Unicode characters. This reduces usability for multilingual environments and RTL languages.
How?
Adds the
JSON_UNESCAPED_UNICODEflag towp_json_encode()calls in:includes/Experiments/Abilities_Explorer/Admin_Page.php
This ensures that schema data is rendered in a human‑readable format while preserving valid JSON output. Existing escaping (
esc_html,esc_textarea) remains unchanged to maintain output safety.Use of AI Tools
AI assistance: Yes
Tool(s): ChatGPT
Model(s): GPT‑5
Used for: Code review suggestion and preparation of the pull request description. Final changes were reviewed and implemented manually.
Testing Instructions
Screenshots or screencast
\u0645\u062d\u062a\u0648\u0627Changelog Entry
Fixed - Improve readability of Ability Explorer schema output by preventing unicode escaping for non‑ASCII characters.