WordPress.org

Make WordPress Core

Changeset 47006


Ignore:
Timestamp:
12/23/2019 02:34:10 PM (21 months ago)
Author:
SergeyBiryukov
Message:

Docs: Improve documentation for admin menu functions:

  • get_admin_page_parent()
  • get_admin_page_title()
  • get_plugin_page_hook()
  • get_plugin_page_hookname()
  • user_can_access_admin_page()

Add missing descriptions and @since tags.

Props subrataemfluence, kennithnichol, stevenlinx, SergeyBiryukov.
Fixes #44253, #49067.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin.php

    r46868 r47006  
    17971797//
    17981798/**
     1799 * Gets the parent file of the current admin page.
     1800 *
     1801 * @since 1.5.0
     1802 *
    17991803 * @global string $parent_file
    18001804 * @global array $menu
     
    18071811 * @global array $_wp_submenu_nopriv
    18081812 *
    1809  * @return string
     1813 * @return string The parent file of the current admin page.
    18101814 */
    18111815function get_admin_page_parent( $parent = '' ) {
     
    18721876
    18731877/**
     1878 * Gets the title of the current admin page.
     1879 *
     1880 * @since 1.5.0
     1881 *
    18741882 * @global string $title
    18751883 * @global array $menu
     
    18791887 * @global string $typenow
    18801888 *
    1881  * @return string
     1889 * @return string The title of the current admin page.
    18821890 */
    18831891function get_admin_page_title() {
     
    19551963
    19561964/**
    1957  * @since 2.3.0
     1965 * Gets the hook attached to the administrative page of a plugin.
     1966 *
     1967 * @since 1.5.0
    19581968 *
    19591969 * @param string $plugin_page The slug name of the plugin page.
     
    19721982
    19731983/**
     1984 * Gets the hook name for the administrative page of a plugin.
     1985 *
     1986 * @since 1.5.0
     1987 *
    19741988 * @global array $admin_page_hooks
    19751989 *
     
    20012015
    20022016/**
     2017 * Determines whether the current user can access the current admin page.
     2018 *
     2019 * @since 1.5.0
     2020 *
    20032021 * @global string $pagenow
    2004  * @global array $menu
    2005  * @global array $submenu
    2006  * @global array $_wp_menu_nopriv
    2007  * @global array $_wp_submenu_nopriv
     2022 * @global array  $menu
     2023 * @global array  $submenu
     2024 * @global array  $_wp_menu_nopriv
     2025 * @global array  $_wp_submenu_nopriv
    20082026 * @global string $plugin_page
    2009  * @global array $_registered_pages
    2010  *
    2011  * @return bool Whether the current user can access the current admin page.
     2027 * @global array  $_registered_pages
     2028 *
     2029 * @return bool True if the current user can access the admin page, false otherwise.
    20122030 */
    20132031function user_can_access_admin_page() {
Note: See TracChangeset for help on using the changeset viewer.