mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 06:57:35 +01:00
Docs: Improve various inline documentation for admin bar functions and hooks.
Props audrasjb See #53399 Built from https://develop.svn.wordpress.org/trunk@51886 git-svn-id: http://core.svn.wordpress.org/trunk@51479 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
41995176f6
commit
cf84fbc988
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Instantiate the admin bar object and set it up as a global for access elsewhere.
|
||||
* Instantiates the admin bar object and set it up as a global for access elsewhere.
|
||||
*
|
||||
* UNHOOKING THIS FUNCTION WILL NOT PROPERLY REMOVE THE ADMIN BAR.
|
||||
* For that, use show_admin_bar(false) or the {@see 'show_admin_bar'} filter.
|
||||
@ -84,13 +84,13 @@ function wp_admin_bar_render() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Load all necessary admin bar items.
|
||||
* Loads all necessary admin bar items.
|
||||
*
|
||||
* This is the hook used to add, remove, or manipulate admin bar items.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance, passed by reference
|
||||
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance, passed by reference.
|
||||
*/
|
||||
do_action_ref_array( 'admin_bar_menu', array( &$wp_admin_bar ) );
|
||||
|
||||
@ -114,11 +114,11 @@ function wp_admin_bar_render() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the WordPress logo menu.
|
||||
* Adds the WordPress logo menu.
|
||||
*
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @param WP_Admin_Bar $wp_admin_bar
|
||||
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
|
||||
*/
|
||||
function wp_admin_bar_wp_menu( $wp_admin_bar ) {
|
||||
if ( current_user_can( 'read' ) ) {
|
||||
@ -198,11 +198,11 @@ function wp_admin_bar_wp_menu( $wp_admin_bar ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the sidebar toggle button.
|
||||
* Adds the sidebar toggle button.
|
||||
*
|
||||
* @since 3.8.0
|
||||
*
|
||||
* @param WP_Admin_Bar $wp_admin_bar
|
||||
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
|
||||
*/
|
||||
function wp_admin_bar_sidebar_toggle( $wp_admin_bar ) {
|
||||
if ( is_admin() ) {
|
||||
@ -217,11 +217,11 @@ function wp_admin_bar_sidebar_toggle( $wp_admin_bar ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the "My Account" item.
|
||||
* Adds the "My Account" item.
|
||||
*
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @param WP_Admin_Bar $wp_admin_bar
|
||||
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
|
||||
*/
|
||||
function wp_admin_bar_my_account_item( $wp_admin_bar ) {
|
||||
$user_id = get_current_user_id();
|
||||
@ -258,11 +258,11 @@ function wp_admin_bar_my_account_item( $wp_admin_bar ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the "My Account" submenu items.
|
||||
* Adds the "My Account" submenu items.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param WP_Admin_Bar $wp_admin_bar
|
||||
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
|
||||
*/
|
||||
function wp_admin_bar_my_account_menu( $wp_admin_bar ) {
|
||||
$user_id = get_current_user_id();
|
||||
@ -328,11 +328,11 @@ function wp_admin_bar_my_account_menu( $wp_admin_bar ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the "Site Name" menu.
|
||||
* Adds the "Site Name" menu.
|
||||
*
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @param WP_Admin_Bar $wp_admin_bar
|
||||
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
|
||||
*/
|
||||
function wp_admin_bar_site_menu( $wp_admin_bar ) {
|
||||
// Don't show for logged out users.
|
||||
@ -413,7 +413,7 @@ function wp_admin_bar_site_menu( $wp_admin_bar ) {
|
||||
*
|
||||
* @since 4.3.0
|
||||
*
|
||||
* @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance.
|
||||
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
|
||||
* @global WP_Customize_Manager $wp_customize
|
||||
*/
|
||||
function wp_admin_bar_customize_menu( $wp_admin_bar ) {
|
||||
@ -455,11 +455,11 @@ function wp_admin_bar_customize_menu( $wp_admin_bar ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the "My Sites/[Site Name]" menu and all submenus.
|
||||
* Adds the "My Sites/[Site Name]" menu and all submenus.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param WP_Admin_Bar $wp_admin_bar
|
||||
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
|
||||
*/
|
||||
function wp_admin_bar_my_sites_menu( $wp_admin_bar ) {
|
||||
// Don't show for logged out users or single site mode.
|
||||
@ -665,11 +665,11 @@ function wp_admin_bar_my_sites_menu( $wp_admin_bar ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a shortlink.
|
||||
* Provides a shortlink.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param WP_Admin_Bar $wp_admin_bar
|
||||
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
|
||||
*/
|
||||
function wp_admin_bar_shortlink_menu( $wp_admin_bar ) {
|
||||
$short = wp_get_shortlink( 0, 'query' );
|
||||
@ -692,7 +692,7 @@ function wp_admin_bar_shortlink_menu( $wp_admin_bar ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide an edit link for posts and terms.
|
||||
* Provides an edit link for posts and terms.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @since 5.5.0 Added a "View Post" link on Comments screen for a single post.
|
||||
@ -703,7 +703,7 @@ function wp_admin_bar_shortlink_menu( $wp_admin_bar ) {
|
||||
* global $user_ID, which contains the ID of the current user.
|
||||
* @global int $post_id The ID of the post when editing comments for a single post.
|
||||
*
|
||||
* @param WP_Admin_Bar $wp_admin_bar
|
||||
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
|
||||
*/
|
||||
function wp_admin_bar_edit_menu( $wp_admin_bar ) {
|
||||
global $tag, $wp_the_query, $user_id, $post_id;
|
||||
@ -836,11 +836,11 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add "Add New" menu.
|
||||
* Adds "Add New" menu.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param WP_Admin_Bar $wp_admin_bar
|
||||
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
|
||||
*/
|
||||
function wp_admin_bar_new_content_menu( $wp_admin_bar ) {
|
||||
$actions = array();
|
||||
@ -912,11 +912,11 @@ function wp_admin_bar_new_content_menu( $wp_admin_bar ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add edit comments link with awaiting moderation count bubble.
|
||||
* Adds edit comments link with awaiting moderation count bubble.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param WP_Admin_Bar $wp_admin_bar
|
||||
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
|
||||
*/
|
||||
function wp_admin_bar_comments_menu( $wp_admin_bar ) {
|
||||
if ( ! current_user_can( 'edit_posts' ) ) {
|
||||
@ -945,11 +945,11 @@ function wp_admin_bar_comments_menu( $wp_admin_bar ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add appearance submenu items to the "Site Name" menu.
|
||||
* Adds appearance submenu items to the "Site Name" menu.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param WP_Admin_Bar $wp_admin_bar
|
||||
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
|
||||
*/
|
||||
function wp_admin_bar_appearance_menu( $wp_admin_bar ) {
|
||||
$wp_admin_bar->add_group(
|
||||
@ -1027,11 +1027,11 @@ function wp_admin_bar_appearance_menu( $wp_admin_bar ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide an update link if theme/plugin/core updates are available.
|
||||
* Provides an update link if theme/plugin/core updates are available.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param WP_Admin_Bar $wp_admin_bar
|
||||
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
|
||||
*/
|
||||
function wp_admin_bar_updates_menu( $wp_admin_bar ) {
|
||||
|
||||
@ -1061,11 +1061,11 @@ function wp_admin_bar_updates_menu( $wp_admin_bar ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add search form.
|
||||
* Adds search form.
|
||||
*
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @param WP_Admin_Bar $wp_admin_bar
|
||||
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
|
||||
*/
|
||||
function wp_admin_bar_search_menu( $wp_admin_bar ) {
|
||||
if ( is_admin() ) {
|
||||
@ -1092,11 +1092,11 @@ function wp_admin_bar_search_menu( $wp_admin_bar ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a link to exit recovery mode when Recovery Mode is active.
|
||||
* Adds a link to exit recovery mode when Recovery Mode is active.
|
||||
*
|
||||
* @since 5.2.0
|
||||
*
|
||||
* @param WP_Admin_Bar $wp_admin_bar
|
||||
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
|
||||
*/
|
||||
function wp_admin_bar_recovery_mode_menu( $wp_admin_bar ) {
|
||||
if ( ! wp_is_recovery_mode() ) {
|
||||
@ -1118,11 +1118,11 @@ function wp_admin_bar_recovery_mode_menu( $wp_admin_bar ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add secondary menus.
|
||||
* Adds secondary menus.
|
||||
*
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @param WP_Admin_Bar $wp_admin_bar
|
||||
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
|
||||
*/
|
||||
function wp_admin_bar_add_secondary_groups( $wp_admin_bar ) {
|
||||
$wp_admin_bar->add_group(
|
||||
@ -1146,7 +1146,7 @@ function wp_admin_bar_add_secondary_groups( $wp_admin_bar ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Style and scripts for the admin bar.
|
||||
* Prints style and scripts for the admin bar.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*/
|
||||
@ -1158,7 +1158,7 @@ function wp_admin_bar_header() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Default admin bar callback.
|
||||
* Prints default admin bar callback.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*/
|
||||
@ -1246,7 +1246,7 @@ function is_admin_bar_showing() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the admin bar display preference of a user.
|
||||
* Retrieves the admin bar display preference of a user.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access private
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.9-alpha-51885';
|
||||
$wp_version = '5.9-alpha-51886';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user