Make WordPress Core

Changeset 58126


Ignore:
Timestamp:
05/10/2024 09:07:33 AM (2 months ago)
Author:
gziolo
Message:

Script Modules: Hooks are not registered in wp-admin

Script Modules cannot be used in wp-admin. The necessary hooks are registered on wp_head or wp_footer, but should also be registered for the admin variants so that modules can be used from wp-admin.

Fixes #61086.
Props jonsurrell, cbravobernal, gziolo.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-script-modules.php

    r58075 r58126  
    179179        add_action( $position, array( $this, 'print_enqueued_script_modules' ) );
    180180        add_action( $position, array( $this, 'print_script_module_preloads' ) );
     181
     182        add_action( 'admin_print_footer_scripts', array( $this, 'print_import_map' ) );
     183        add_action( 'admin_print_footer_scripts', array( $this, 'print_enqueued_script_modules' ) );
     184        add_action( 'admin_print_footer_scripts', array( $this, 'print_script_module_preloads' ) );
    181185    }
    182186
Note: See TracChangeset for help on using the changeset viewer.