Skip to content

Fix Persian/RTL characters display in Ability Explorer schemas#740

Merged
dkotter merged 3 commits into
WordPress:developfrom
kabookhypnosis:develop
Jun 17, 2026
Merged

Fix Persian/RTL characters display in Ability Explorer schemas#740
dkotter merged 3 commits into
WordPress:developfrom
kabookhypnosis:develop

Conversation

@kabookhypnosis

@kabookhypnosis kabookhypnosis commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

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_UNICODE flag to wp_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

  1. Enable the AI plugin locally.
  2. Open Tools → AI → Abilities Explorer.
  3. Register or test an ability containing Persian or other non‑ASCII text in its schema.
  4. Verify that characters are displayed directly instead of escaped unicode sequences.

Screenshots or screencast

Before After
Persian text displayed as \u0645\u062d\u062a\u0648\u0627 Persian text displayed correctly

Changelog Entry

Fixed - Improve readability of Ability Explorer schema output by preventing unicode escaping for non‑ASCII characters.

Open WordPress Playground Preview

Add JSON_UNESCAPED_UNICODE flag to wp_json_encode calls to properly display non-ASCII characters.
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: kabookhypnosis <saeidafshari@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

dkotter added 2 commits June 17, 2026 16:17
… we output the schema in a script block, since this doesn't pass through escaping functions
@dkotter dkotter added this to the 1.1.0 milestone Jun 17, 2026
@dkotter dkotter merged commit af999ff into WordPress:develop Jun 17, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants