get_plugin_page_hook

The timeline below displays how wordpress function get_plugin_page_hook has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.4

/**
 * Gets the hook attached to the administrative page of a plugin.
 *
 * @since 1.5.0
 *
 * @param string $plugin_page The slug name of the plugin page.
 * @param string $parent_page 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.
 */
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;
    }
}

WordPress Version: 5.2

/**
 * @since 2.3.0
 *
 * @param string $plugin_page The slug name of the plugin page.
 * @param string $parent_page 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.
 */
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;
    }
}

WordPress Version: 4.3

/**
 * @since 2.3.0
 *
 * @param string $plugin_page
 * @param string $parent_page
 * @return string|null
 */
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;
    }
}

WordPress Version: 3.7

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