Skip to content

Commit

Permalink
Docs: Add missing description for a few globals in the admin.
Browse files Browse the repository at this point in the history
This affects:

* `$post_type`
* `$post_type_object`
* `$taxonomy`
* `$title`
* `$wp_meta_boxes`

Follow-up to [31121], [32642], [32643], [37890], [43815], [44244], [45742], [53060], [53061], [54831].

Props shub07, 1naveengiri, sabernhardt, SergeyBiryukov.
Fixes #59561.

git-svn-id: https://develop.svn.wordpress.org/trunk@58419 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jun 15, 2024
1 parent c756dfe commit dc6c8c8
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/wp-admin/admin-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* In case admin-header.php is included in a function.
*
* @global string $title
* @global string $title The title of the current screen.
* @global string $hook_suffix
* @global WP_Screen $current_screen WordPress current screen object.
* @global WP_Locale $wp_locale WordPress date and time locale object.
Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/edit-form-advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
}

/**
* @global string $post_type
* @global WP_Post_Type $post_type_object
* @global string $post_type Global post type.
* @global WP_Post_Type $post_type_object Global post type object.
* @global WP_Post $post Global post object.
*/
global $post_type, $post_type_object, $post;
Expand Down
8 changes: 4 additions & 4 deletions src/wp-admin/edit-form-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
}

/**
* @global string $post_type
* @global WP_Post_Type $post_type_object
* @global string $post_type Global post type.
* @global WP_Post_Type $post_type_object Global post type object.
* @global WP_Post $post Global post object.
* @global string $title
* @global array $wp_meta_boxes
* @global string $title The title of the current screen.
* @global array $wp_meta_boxes Global meta box state.
*/
global $post_type, $post_type_object, $post, $title, $wp_meta_boxes;

Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/edit-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
}

/**
* $post_type is set when the WP_Terms_List_Table instance is created
* $post_type is set when the WP_Terms_List_Table instance is created.
*
* @global string $post_type
* @global string $post_type Global post type.
*/
global $post_type;

Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
}

/**
* @global string $post_type
* @global WP_Post_Type $post_type_object
* @global string $post_type Global post type.
* @global WP_Post_Type $post_type_object Global post type object.
*/
global $post_type, $post_type_object;

Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-wp-posts-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class WP_Posts_List_Table extends WP_List_Table {
*
* @see WP_List_Table::__construct() for more information on default arguments.
*
* @global WP_Post_Type $post_type_object
* @global WP_Post_Type $post_type_object Global post type object.
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param array $args An associative array of arguments.
Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/includes/class-wp-screen.php
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ public function render_screen_meta() {
}

/**
* @global array $wp_meta_boxes
* @global array $wp_meta_boxes Global meta box state.
*
* @return bool
*/
Expand Down Expand Up @@ -1103,7 +1103,7 @@ public function render_screen_options( $options = array() ) {
*
* @since 4.4.0
*
* @global array $wp_meta_boxes
* @global array $wp_meta_boxes Global meta box state.
*/
public function render_meta_boxes_preferences() {
global $wp_meta_boxes;
Expand Down
7 changes: 4 additions & 3 deletions src/wp-admin/includes/class-wp-terms-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class WP_Terms_List_Table extends WP_List_Table {
*
* @see WP_List_Table::__construct() for more information on default arguments.
*
* @global string $post_type
* @global string $taxonomy
* @global string $post_type Global post type.
* @global string $taxonomy Global taxonomy.
* @global string $action
* @global object $tax
*
Expand Down Expand Up @@ -330,7 +330,8 @@ private function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$coun
}

/**
* @global string $taxonomy
* @global string $taxonomy Global taxonomy.
*
* @param WP_Term $tag Term object.
* @param int $level
*/
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/nav-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function wp_nav_menu_setup() {
*
* @since 3.0.0
*
* @global array $wp_meta_boxes
* @global array $wp_meta_boxes Global meta box state.
*/
function wp_initial_nav_menu_meta_boxes() {
global $wp_meta_boxes;
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2030,7 +2030,7 @@ function get_admin_page_parent( $parent_page = '' ) {
*
* @since 1.5.0
*
* @global string $title
* @global string $title The title of the current screen.
* @global array $menu
* @global array $submenu
* @global string $pagenow The filename of the current screen.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -2345,7 +2345,7 @@ function get_block_editor_server_block_settings() {
*
* @global WP_Post $post Global post object.
* @global WP_Screen $current_screen WordPress current screen object.
* @global array $wp_meta_boxes
* @global array $wp_meta_boxes Global meta box state.
*/
function the_block_editor_meta_boxes() {
global $post, $current_screen, $wp_meta_boxes;
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/screen.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function get_hidden_columns( $screen ) {
*
* @since 2.7.0
*
* @global array $wp_meta_boxes
* @global array $wp_meta_boxes Global meta box state.
*
* @param WP_Screen $screen
*/
Expand Down
6 changes: 3 additions & 3 deletions src/wp-admin/includes/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ function wp_import_upload_form( $action ) {
* @since 2.5.0
* @since 4.4.0 The `$screen` parameter now accepts an array of screen IDs.
*
* @global array $wp_meta_boxes
* @global array $wp_meta_boxes Global meta box state.
*
* @param string $id Meta box ID (used in the 'id' attribute for the meta box).
* @param string $title Title of the meta box.
Expand Down Expand Up @@ -1287,7 +1287,7 @@ function _get_plugin_from_callback( $callback ) {
*
* @since 2.5.0
*
* @global array $wp_meta_boxes
* @global array $wp_meta_boxes Global meta box state.
*
* @param string|WP_Screen $screen The screen identifier. If you have used add_menu_page() or
* add_submenu_page() to create a new screen (and hence screen_id)
Expand Down Expand Up @@ -1472,7 +1472,7 @@ function do_meta_boxes( $screen, $context, $data_object ) {
* @since 2.6.0
* @since 4.4.0 The `$screen` parameter now accepts an array of screen IDs.
*
* @global array $wp_meta_boxes
* @global array $wp_meta_boxes Global meta box state.
*
* @param string $id Meta box ID (used in the 'id' attribute for the meta box).
* @param string|array|WP_Screen $screen The screen or screens on which the meta box is shown (such as a
Expand Down
6 changes: 3 additions & 3 deletions src/wp-admin/post-new.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
require_once __DIR__ . '/admin.php';

/**
* @global string $post_type
* @global object $post_type_object
* @global WP_Post $post Global post object.
* @global string $post_type Global post type.
* @global WP_Post_Type $post_type_object Global post type object.
* @global WP_Post $post Global post object.
*/
global $post_type, $post_type_object, $post;

Expand Down
6 changes: 3 additions & 3 deletions src/wp-admin/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
$post_ID = $post_id;

/**
* @global string $post_type
* @global object $post_type_object
* @global WP_Post $post Global post object.
* @global string $post_type Global post type.
* @global WP_Post_Type $post_type_object Global post type object.
* @global WP_Post $post Global post object.
*/
global $post_type, $post_type_object, $post;

Expand Down

0 comments on commit dc6c8c8

Please sign in to comment.