[wp-trac] [WordPress Trac] #60862: wp_localize_script() on login_enqueue_scripts hook change in behavior

WordPress Trac noreply at wordpress.org
Tue Apr 9 10:48:39 UTC 2024


#60862: wp_localize_script() on login_enqueue_scripts hook change in behavior
----------------------------------------+---------------------
 Reporter:  salcode                     |       Owner:  (none)
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  6.5.1
Component:  Script Loader               |     Version:  6.5
 Severity:  normal                      |  Resolution:
 Keywords:  needs-unit-tests has-patch  |     Focuses:
----------------------------------------+---------------------

Comment (by gziolo):

 > If you're seeing different behavior in 6.5, that might be because of
 [57590]. I recommend opening a new ticket for this. FYI @gziolo.

 There are no functional changes in the linked changeset that would impact
 registration. It's only a special case that allows the script handle to be
 provided in the asset file. So it might be something else.

 > If you pass editor_script to register_block_type, it will automatically
 call register_block_script_handle for it, which means it will call
 wp_register_script. But you are already registering the script yourself,
 so that will get overridden.

 If the script handle gets passed then during the block registration it
 only gets linked to the block, it never get registrated again. The
 registration only happens when the path to the file gets provided in
 `block.json`.

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


More information about the wp-trac mailing list