WordPress.org

Make WordPress Core

Changeset 51886


Ignore:
Timestamp:
10/04/2021 08:45:36 PM (2 months ago)
Author:
johnbillion
Message:

Docs: Improve various inline documentation for admin bar functions and hooks.

Props audrasjb

See #53399

File:
1 edited

Legend:

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

    r51672 r51886  
    99
    1010/**
    11  * Instantiate the admin bar object and set it up as a global for access elsewhere.
     11 * Instantiates the admin bar object and set it up as a global for access elsewhere.
    1212 *
    1313 * UNHOOKING THIS FUNCTION WILL NOT PROPERLY REMOVE THE ADMIN BAR.
     
    8585
    8686    /**
    87      * Load all necessary admin bar items.
     87     * Loads all necessary admin bar items.
    8888     *
    8989     * This is the hook used to add, remove, or manipulate admin bar items.
     
    9191     * @since 3.1.0
    9292     *
    93      * @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance, passed by reference
     93     * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance, passed by reference.
    9494     */
    9595    do_action_ref_array( 'admin_bar_menu', array( &$wp_admin_bar ) );
     
    115115
    116116/**
    117  * Add the WordPress logo menu.
     117 * Adds the WordPress logo menu.
    118118 *
    119119 * @since 3.3.0
    120120 *
    121  * @param WP_Admin_Bar $wp_admin_bar
     121 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
    122122 */
    123123function wp_admin_bar_wp_menu( $wp_admin_bar ) {
     
    199199
    200200/**
    201  * Add the sidebar toggle button.
     201 * Adds the sidebar toggle button.
    202202 *
    203203 * @since 3.8.0
    204204 *
    205  * @param WP_Admin_Bar $wp_admin_bar
     205 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
    206206 */
    207207function wp_admin_bar_sidebar_toggle( $wp_admin_bar ) {
     
    218218
    219219/**
    220  * Add the "My Account" item.
     220 * Adds the "My Account" item.
    221221 *
    222222 * @since 3.3.0
    223223 *
    224  * @param WP_Admin_Bar $wp_admin_bar
     224 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
    225225 */
    226226function wp_admin_bar_my_account_item( $wp_admin_bar ) {
     
    259259
    260260/**
    261  * Add the "My Account" submenu items.
    262  *
    263  * @since 3.1.0
    264  *
    265  * @param WP_Admin_Bar $wp_admin_bar
     261 * Adds the "My Account" submenu items.
     262 *
     263 * @since 3.1.0
     264 *
     265 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
    266266 */
    267267function wp_admin_bar_my_account_menu( $wp_admin_bar ) {
     
    329329
    330330/**
    331  * Add the "Site Name" menu.
     331 * Adds the "Site Name" menu.
    332332 *
    333333 * @since 3.3.0
    334334 *
    335  * @param WP_Admin_Bar $wp_admin_bar
     335 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
    336336 */
    337337function wp_admin_bar_site_menu( $wp_admin_bar ) {
     
    414414 * @since 4.3.0
    415415 *
    416  * @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance.
     416 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
    417417 * @global WP_Customize_Manager $wp_customize
    418418 */
     
    456456
    457457/**
    458  * Add the "My Sites/[Site Name]" menu and all submenus.
    459  *
    460  * @since 3.1.0
    461  *
    462  * @param WP_Admin_Bar $wp_admin_bar
     458 * Adds the "My Sites/[Site Name]" menu and all submenus.
     459 *
     460 * @since 3.1.0
     461 *
     462 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
    463463 */
    464464function wp_admin_bar_my_sites_menu( $wp_admin_bar ) {
     
    666666
    667667/**
    668  * Provide a shortlink.
    669  *
    670  * @since 3.1.0
    671  *
    672  * @param WP_Admin_Bar $wp_admin_bar
     668 * Provides a shortlink.
     669 *
     670 * @since 3.1.0
     671 *
     672 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
    673673 */
    674674function wp_admin_bar_shortlink_menu( $wp_admin_bar ) {
     
    693693
    694694/**
    695  * Provide an edit link for posts and terms.
     695 * Provides an edit link for posts and terms.
    696696 *
    697697 * @since 3.1.0
     
    704704 * @global int      $post_id      The ID of the post when editing comments for a single post.
    705705 *
    706  * @param WP_Admin_Bar $wp_admin_bar
     706 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
    707707 */
    708708function wp_admin_bar_edit_menu( $wp_admin_bar ) {
     
    837837
    838838/**
    839  * Add "Add New" menu.
    840  *
    841  * @since 3.1.0
    842  *
    843  * @param WP_Admin_Bar $wp_admin_bar
     839 * Adds "Add New" menu.
     840 *
     841 * @since 3.1.0
     842 *
     843 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
    844844 */
    845845function wp_admin_bar_new_content_menu( $wp_admin_bar ) {
     
    913913
    914914/**
    915  * Add edit comments link with awaiting moderation count bubble.
    916  *
    917  * @since 3.1.0
    918  *
    919  * @param WP_Admin_Bar $wp_admin_bar
     915 * Adds edit comments link with awaiting moderation count bubble.
     916 *
     917 * @since 3.1.0
     918 *
     919 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
    920920 */
    921921function wp_admin_bar_comments_menu( $wp_admin_bar ) {
     
    946946
    947947/**
    948  * Add appearance submenu items to the "Site Name" menu.
    949  *
    950  * @since 3.1.0
    951  *
    952  * @param WP_Admin_Bar $wp_admin_bar
     948 * Adds appearance submenu items to the "Site Name" menu.
     949 *
     950 * @since 3.1.0
     951 *
     952 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
    953953 */
    954954function wp_admin_bar_appearance_menu( $wp_admin_bar ) {
     
    10281028
    10291029/**
    1030  * Provide an update link if theme/plugin/core updates are available.
    1031  *
    1032  * @since 3.1.0
    1033  *
    1034  * @param WP_Admin_Bar $wp_admin_bar
     1030 * Provides an update link if theme/plugin/core updates are available.
     1031 *
     1032 * @since 3.1.0
     1033 *
     1034 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
    10351035 */
    10361036function wp_admin_bar_updates_menu( $wp_admin_bar ) {
     
    10621062
    10631063/**
    1064  * Add search form.
     1064 * Adds search form.
    10651065 *
    10661066 * @since 3.3.0
    10671067 *
    1068  * @param WP_Admin_Bar $wp_admin_bar
     1068 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
    10691069 */
    10701070function wp_admin_bar_search_menu( $wp_admin_bar ) {
     
    10931093
    10941094/**
    1095  * Add a link to exit recovery mode when Recovery Mode is active.
     1095 * Adds a link to exit recovery mode when Recovery Mode is active.
    10961096 *
    10971097 * @since 5.2.0
    10981098 *
    1099  * @param WP_Admin_Bar $wp_admin_bar
     1099 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
    11001100 */
    11011101function wp_admin_bar_recovery_mode_menu( $wp_admin_bar ) {
     
    11191119
    11201120/**
    1121  * Add secondary menus.
     1121 * Adds secondary menus.
    11221122 *
    11231123 * @since 3.3.0
    11241124 *
    1125  * @param WP_Admin_Bar $wp_admin_bar
     1125 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
    11261126 */
    11271127function wp_admin_bar_add_secondary_groups( $wp_admin_bar ) {
     
    11471147
    11481148/**
    1149  * Style and scripts for the admin bar.
     1149 * Prints style and scripts for the admin bar.
    11501150 *
    11511151 * @since 3.1.0
     
    11591159
    11601160/**
    1161  * Default admin bar callback.
     1161 * Prints default admin bar callback.
    11621162 *
    11631163 * @since 3.1.0
     
    12471247
    12481248/**
    1249  * Retrieve the admin bar display preference of a user.
     1249 * Retrieves the admin bar display preference of a user.
    12501250 *
    12511251 * @since 3.1.0
Note: See TracChangeset for help on using the changeset viewer.