On this page
get_plugin_page_hook( string $plugin_page, string $parent_page ): string|null
Gets the hook attached to the administrative page of a plugin.
Parameters
$plugin_pagestring Required-
The slug name of the plugin page.
$parent_pagestring Required-
The slug name for the parent menu (or the file name of a standard WordPress admin page).
Return
string|null Hook attached to the plugin page, null otherwise.
Source
File: wp-admin/includes/plugin.php. View all references
function get_plugin_page_hook( $plugin_page, $parent_page ) {
$hook = get_plugin_page_hookname( $plugin_page, $parent_page );
if ( has_action( $hook ) ) {
return $hook;
} else {
return null;
}
}
Related
Uses
| Uses | Description |
|---|---|
| get_plugin_page_hookname() wp-admin/includes/plugin.php | Gets the hook name for the administrative page of a plugin. |
| has_action() wp-includes/plugin.php | Checks if any action has been registered for a hook. |
Used By
| Used By | Description |
|---|---|
| get_admin_page_title() wp-admin/includes/plugin.php | Gets the title of the current admin page. |
| _wp_menu_output() wp-admin/menu-header.php | Display menu. |
Changelog
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_plugin_page_hook