Title: get_plugin_page_hook
Published: April 25, 2014
Last modified: February 24, 2026

---

# get_plugin_page_hook( string $plugin_page, string $parent_page ): string|null

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/get_plugin_page_hook/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/get_plugin_page_hook/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_plugin_page_hook/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/get_plugin_page_hook/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_plugin_page_hook/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/get_plugin_page_hook/?output_format=md#wp--skip-link--target)

Gets the hook attached to the administrative page of a plugin.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/get_plugin_page_hook/?output_format=md#parameters)󠁿

 `$plugin_page`stringrequired

The slug name of the plugin page.

`$parent_page`stringrequired

The slug name for the parent menu (or the file name of a standard WordPress admin
page).

## 󠀁[Return](https://developer.wordpress.org/reference/functions/get_plugin_page_hook/?output_format=md#return)󠁿

 string|null Hook attached to the plugin page, null otherwise.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/get_plugin_page_hook/?output_format=md#source)󠁿

    ```php
    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;
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/plugin.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-admin/includes/plugin.php#L2137)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/plugin.php#L2137-L2144)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/get_plugin_page_hook/?output_format=md#related)󠁿

| Uses | Description | 
| [get_plugin_page_hookname()](https://developer.wordpress.org/reference/functions/get_plugin_page_hookname/)`wp-admin/includes/plugin.php` |

Gets the hook name for the administrative page of a plugin.

  | 
| [has_action()](https://developer.wordpress.org/reference/functions/has_action/)`wp-includes/plugin.php` |

Checks if any action has been registered for a hook.

  |

| Used by | Description | 
| [get_admin_page_title()](https://developer.wordpress.org/reference/functions/get_admin_page_title/)`wp-admin/includes/plugin.php` |

Gets the title of the current admin page.

  | 
| [_wp_menu_output()](https://developer.wordpress.org/reference/functions/_wp_menu_output/)`wp-admin/menu-header.php` |

Display menu.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_plugin_page_hook/?output_format=md#changelog)󠁿

| Version | Description | 
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_plugin_page_hook%2F)
before being able to contribute a note or feedback.