Opened 9 years ago
Closed 9 years ago
#32670 closed defect (bug) (fixed)
Menu names in customizer shows HTML entities
Reported by: | markoheijnen | Owned by: | ocean90 |
---|---|---|---|
Milestone: | 4.3 | Priority: | normal |
Severity: | normal | Version: | 4.3 |
Component: | Customize | Keywords: | has-patch |
Focuses: | Cc: |
Description
Currently when "Menus" is translated with entities like ' for Dutch "Menu's" then it's not correctly parsed due to the usage of {{menu.title}}. When this is menu.title
then the value is displayed correctly.
I only fixed it for menus but I saw other places with only 2 brackets too. Unsure when to use what.
Attachments (2)
Change History (9)
#3
@
9 years ago
Looking over the code, I do see places where it's placed but it doesn't work. It still could placed when WP_Customize_Nav_Menus_Panel get's created but the title of WP_Customize_Nav_Menu_Section already get's it but still fails to parse correctly.
#4
@
9 years ago
The following code does work. I placed it inside WP_Customize_Panel->json();
$array['title'] = $output = preg_replace_callback("/(&#[0-9]+;)/", function($m) { return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES"); }, $array['title']);
#5
@
9 years ago
- Keywords has-patch added; needs-patch removed
32670.patch adds html_entity_decode()
to section/panel titles.
{{}}
is needed for escaping. We probably missed an instance ofhtml_entity_decode()
.