[wp-trac] [WordPress Trac] #39335: Twenty Seventeen: customize-controls.js incorrectly assumes theme_options section is always present

WordPress Trac noreply at wordpress.org
Thu Jan 25 07:53:43 UTC 2024


#39335: Twenty Seventeen: customize-controls.js incorrectly assumes theme_options
section is always present
-----------------------------------+----------------------------
 Reporter:  westonruter            |       Owner:  davidakennedy
     Type:  defect (bug)           |      Status:  closed
 Priority:  normal                 |   Milestone:  4.7.1
Component:  Bundled Theme          |     Version:  4.7
 Severity:  normal                 |  Resolution:  fixed
 Keywords:  has-patch fixed-major  |     Focuses:
-----------------------------------+----------------------------

Comment (by qwerty12345q):

 Assuming the theme options section is always present can lead to issues
 when plugins modify core constructs.

 **To address this, consider the following:**

 Deferred Pattern: Use a deferred pattern in customize-controls.js to check
 and ensure the presence of Customizer constructs before manipulating them.

 Conditional Checks: Implement conditional checks for the existence of
 panels, sections, controls, and settings in the script.

 Graceful Handling: Provide fallbacks or informative messages for cases
 where expected constructs are not present.

 Documentation: Clearly document assumptions and expected behaviors in the
 script.
 [[span(style=display: none, https://example.com )]]
 Compatibility Testing: Regularly test themes with plugins that modify
 Customizer constructs to ensure compatibility.

 **Hope this helps**
 [[span(style=display: none, https://example.com )]]

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


More information about the wp-trac mailing list