WordPress action hook · part of WordPress core

admin_print_scripts-widgets.php

A WordPress core action that 11 plugins also fire themselves, running on 11.5M+ sites between them.

“This action is documented in wp-admin/admin-header.php”

How to use admin_print_scripts-widgets.php

It's an action: your callback runs at that point. Nothing needs to be returned. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_action( 'admin_print_scripts-widgets.php', function() {
	// Your code runs here.
}, 10, 1 );

Argument names come from Elementor Agent Ready Website Builder's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

11 plugins that fire admin_print_scripts-widgets.php

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Elementor Agent Ready Website Builder icon Elementor Agent Ready Website Builder10+ million installs do_action( 'admin_print_scripts-widgets.php' ) includes/managers/wordpress-widgets.php:70
  2. Website Builder by SeedProd icon Website Builder by SeedProd600,000+ installs do_action( 'admin_print_scripts-widgets.php' ) app/bootstrap.php:436
  3. The Events Calendar icon The Events Calendar600,000+ installs do_action( 'admin_print_scripts-widgets.php' ) src/Tribe/Editor/Hooks.php:86
  4. Max Mega Menu icon Max Mega Menu300,000+ installs do_action( 'admin_print_scripts-widgets.php' ) megamenu.php:237
  5. QuadMenu icon QuadMenu10,000+ installs do_action( 'admin_print_scripts-widgets.php' ) lib/backend/walker/class-nav-menu-widgets.php:447
  6. WP Mega Menu icon WP Mega Menu8,000+ installs do_action( 'admin_print_scripts-widgets.php' ) classes/class.wp-megamenu-base.php:169
  7. Themify Builder icon Themify Builder6,000+ installs do_action( 'admin_print_scripts-widgets.php' ) themify/megamenu/class-mega-menu.php:650
  8. Easy Mega Menu for WordPress icon Easy Mega Menu for WordPress1,000+ installs do_action( 'admin_print_scripts-widgets.php' ) inc/megamenu-base.php:22
  9. X3P0 Legacy Widget icon X3P0 Legacy Widget200+ installs do_action( 'admin_print_scripts-widgets.php' ) src/Plugin.php:113
  10. Legacy Widgets in Block Editor icon Legacy Widgets in Block EditorFewer than 10 installs do_action( 'admin_print_scripts-widgets.php' ) legacy-widgets-in-block-editor.php:42
  11. Mega Navify icon Mega NavifyFewer than 10 installs do_action( 'admin_print_scripts-widgets.php' ) includes/class-meganavify-scripts.php:120

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.