Action hook 'load-{$plugin_page}'

in WP Core File wp-admin/admin.php at line 285

View Source

load-{$plugin_page}

Action Hook
Description
Fires before a particular screen is loaded. The load-* hook fires in a number of contexts. This hook is for plugin screens where the file to load is directly included, rather than the use of a function. The dynamic portion of the hook name, `$plugin_page`, refers to the plugin basename.

Hook Information

File Location wp-admin/admin.php View on GitHub
Hook Type Action
Line Number 285

Hook Parameters

This hook doesn't accept any parameters.

Usage Examples

Basic Usage
<?php
// Hook into load-{$plugin_page}
add_action('load-{$plugin_page}', 'my_custom_function');

function my_custom_function() {
    // Your custom code here
}

Source Code Context

wp-admin/admin.php:285 - How this hook is used in WordPress core
<?php
 280  		 *
 281  		 * @see plugin_basename()
 282  		 *
 283  		 * @since 1.5.0
 284  		 */
 285  		do_action( "load-{$plugin_page}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
 286  
 287  		if ( ! isset( $_GET['noheader'] ) ) {
 288  			require_once ABSPATH . 'wp-admin/admin-header.php';
 289  		}
 290  

PHP Documentation

<?php
/**
		 * Fires before a particular screen is loaded.
		 *
		 * The load-* hook fires in a number of contexts. This hook is for plugin screens
		 * where the file to load is directly included, rather than the use of a function.
		 *
		 * The dynamic portion of the hook name, `$plugin_page`, refers to the plugin basename.
		 *
		 * @see plugin_basename()
		 *
		 * @since 1.5.0
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 0
  • File: wp-admin/admin.php
Related Hooks

Related hooks will be displayed here in future updates.