get_plugin_page_hook

The WordPress Core get plugin page hook function.

Description

(string|null) get_plugin_page_hook( (string) $plugin_page, (string) $parent_page ); 

Returns (string|null)

Parameters (2)

0. $plugin_page (string)
The plugin page.
1. $parent_page (string)
The parent page.

Usage

  1. if ( !function_exists( 'get_plugin_page_hook' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/plugin.php'; 
  3.  
  4. // The plugin page. 
  5. $plugin_page = ''; 
  6.  
  7. // The parent page. 
  8. $parent_page = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = get_plugin_page_hook($plugin_page, $parent_page); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/plugin.php  
  1. function get_plugin_page_hook( $plugin_page, $parent_page ) { 
  2. $hook = get_plugin_page_hookname( $plugin_page, $parent_page ); 
  3. if ( has_action($hook) ) 
  4. return $hook; 
  5. else 
  6. return null;