函数原型
get_plugin_page_hook( string $plugin_page, string $parent_page ): string|null
函数描述
Gets the hook attached to the administrative page of a plugin.
是否弃用
未弃用
函数参数
-
$plugin_page
string
Required - The slug name of the plugin page.
-
$parent_page
string
Required - The slug name for the parent menu (or the file name of a standard WordPress admin page).
函数返回值
string|null Hook attached to the plugin page, null otherwise.
函数位置
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;
}
}
源码链接
变更日志
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |

