get_plugin_page_hook

Advertisement

Summery Summery

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

Syntax Syntax

get_plugin_page_hook( string $plugin_page, string $parent_page )

Parameters Parameters

$plugin_page

(Required) The slug name of the plugin page.

$parent_page

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

Return Return

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

Source Source

File: wp-admin/includes/plugin.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;
	}
}

Advertisement

Changelog Changelog

Changelog
Version Description
1.5.0 Introduced.

Advertisement

Leave a Reply