[wp-trac] [WordPress Trac] #62713: Policies accordion does not work for plugin names with non-English characters

WordPress Trac noreply at wordpress.org
Thu Dec 19 07:18:43 UTC 2024


#62713: Policies accordion does not work for plugin names with non-English
characters
-------------------------+-------------------------------------------------
 Reporter:  ecgan        |       Owner:  (none)
     Type:  defect       |      Status:  new
  (bug)                  |
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:  6.7.1
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  ui, javascript, administration,
                         |  privacy
-------------------------+-------------------------------------------------

Comment (by ecgan):

 The jQuery JavaScript code that finds the accordion block does not work
 because the element ID contains characters that needs to be escape.

 See: [https://learn.jquery.com/using-jquery-core/faq/how-do-i-select-an-
 element-by-an-id-that-has-characters-used-in-css-notation/ How do I select
 an element by an ID that has characters used in CSS notation?]

 WordPress is calling it like below, which is causing the JavaScript
 console error:


 {{{
 jQuery('#privacy-settings-accordion-block-points-et-r%c3%a9compenses')
 }}}

 If we do the escaping like below, then it would work as expected:


 {{{
 jQuery('#privacy-settings-accordion-block-points-et-r\\%c3\\%a9compenses')
 }}}

 Alternatively, we may also try this without jQuery:

 {{{
 document.getElementById('privacy-settings-accordion-block-points-
 et-r%c3%a9compenses')​
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62713#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list