[wp-trac] [WordPress Trac] #65070: Move inline JS from admin_head hooks in options screens into options.js

WordPress Trac noreply at wordpress.org
Tue Apr 14 09:26:03 UTC 2026


#65070: Move inline JS from admin_head hooks in options screens into options.js
----------------------------+-----------------------------
 Reporter:  anukasha        |      Owner:  (none)
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:
 Severity:  normal          |   Keywords:  needs-patch
  Focuses:                  |
----------------------------+-----------------------------
 src/wp-admin/includes/options.php contains three functions that print
 inline <script> blocks via admin_head hooks:
 1. options_discussion_add_js() — hooked in options-discussion.php
 2. options_general_add_js() — hooked in options-general.php
 3. options_reading_add_js() — hooked in options-reading.php

 These should be migrated into src/js/_enqueues/admin/options.js, which was
 introduced in [https://github.com/WordPress/wordpress-develop/pull/10927]
 as the central enqueued JS file for options screens.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/65070>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list