Docs: A host of corrections and improvements to inline documentation.

See #57840

Built from https://develop.svn.wordpress.org/trunk@55732


git-svn-id: http://core.svn.wordpress.org/trunk@55244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2023-05-08 22:37:24 +00:00
parent 2ffb7ef083
commit 5ef972680a
26 changed files with 79 additions and 63 deletions

View File

@ -21,7 +21,7 @@ class WP_Application_Passwords_List_Table extends WP_List_Table {
* *
* @since 5.6.0 * @since 5.6.0
* *
* @return array * @return string[] Array of column titles keyed by their column name.
*/ */
public function get_columns() { public function get_columns() {
return array( return array(

View File

@ -458,7 +458,7 @@ class WP_Comments_List_Table extends WP_List_Table {
/** /**
* @global int $post_id * @global int $post_id
* *
* @return array * @return string[] Array of column titles keyed by their column name.
*/ */
public function get_columns() { public function get_columns() {
global $post_id; global $post_id;

View File

@ -124,7 +124,7 @@ class WP_Links_List_Table extends WP_List_Table {
} }
/** /**
* @return array * @return string[] Array of column titles keyed by their column name.
*/ */
public function get_columns() { public function get_columns() {
return array( return array(

View File

@ -320,7 +320,7 @@ class WP_Media_List_Table extends WP_List_Table {
} }
/** /**
* @return array * @return string[] Array of column titles keyed by their column name.
*/ */
public function get_columns() { public function get_columns() {
$posts_columns = array(); $posts_columns = array();

View File

@ -359,7 +359,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
} }
/** /**
* @return array * @return string[] Array of column titles keyed by their column name.
*/ */
public function get_columns() { public function get_columns() {
$sites_columns = array( $sites_columns = array(

View File

@ -322,7 +322,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
} }
/** /**
* @return array * @return string[] Array of column titles keyed by their column name.
*/ */
public function get_columns() { public function get_columns() {
$columns = array( $columns = array(

View File

@ -185,7 +185,7 @@ class WP_MS_Users_List_Table extends WP_List_Table {
} }
/** /**
* @return array * @return string[] Array of column titles keyed by their column name.
*/ */
public function get_columns() { public function get_columns() {
$users_columns = array( $users_columns = array(

View File

@ -424,7 +424,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
} }
/** /**
* @return array * @return string[] Array of column titles keyed by their column name.
*/ */
public function get_columns() { public function get_columns() {
return array(); return array();

View File

@ -451,7 +451,8 @@ class WP_Plugins_List_Table extends WP_List_Table {
/** /**
* @global string $status * @global string $status
* @return array *
* @return string[] Array of column titles keyed by their column name.
*/ */
public function get_columns() { public function get_columns() {
global $status; global $status;

View File

@ -651,7 +651,7 @@ class WP_Posts_List_Table extends WP_List_Table {
} }
/** /**
* @return array * @return string[] Array of column titles keyed by their column name.
*/ */
public function get_columns() { public function get_columns() {
$post_type = $this->screen->post_type; $post_type = $this->screen->post_type;

View File

@ -185,7 +185,7 @@ class WP_Terms_List_Table extends WP_List_Table {
} }
/** /**
* @return array * @return string[] Array of column titles keyed by their column name.
*/ */
public function get_columns() { public function get_columns() {
$columns = array( $columns = array(

View File

@ -170,7 +170,7 @@ class WP_Themes_List_Table extends WP_List_Table {
} }
/** /**
* @return array * @return string[] Array of column titles keyed by their column name.
*/ */
public function get_columns() { public function get_columns() {
return array(); return array();

View File

@ -1345,7 +1345,6 @@ function wp_generate_block_templates_export_file() {
/** /**
* Gets the template hierarchy for the given template slug to be created. * Gets the template hierarchy for the given template slug to be created.
* *
*
* Note: Always add `index` as the last fallback template. * Note: Always add `index` as the last fallback template.
* *
* @since 6.1.0 * @since 6.1.0

View File

@ -68,8 +68,22 @@ class WP_Application_Passwords {
* @type string $name The name of the application password. * @type string $name The name of the application password.
* @type string $app_id A UUID provided by the application to uniquely identify it. * @type string $app_id A UUID provided by the application to uniquely identify it.
* } * }
* @return array|WP_Error The first key in the array is the new password, the second is its detailed information. * @return array|WP_Error {
* A WP_Error instance is returned on error. * Application password details, or a WP_Error instance if an error occurs.
*
* @type string $0 The unhashed generated application password.
* @type array $1 {
* The details about the created password.
*
* @type string $uuid The unique identifier for the application password.
* @type string $app_id A UUID provided by the application to uniquely identify it.
* @type string $name The name of the application password.
* @type string $password A one-way hash of the password.
* @type int $created Unix timestamp of when the password was created.
* @type null $last_used Null.
* @type null $last_ip Null.
* }
* }
*/ */
public static function create_new_application_password( $user_id, $args = array() ) { public static function create_new_application_password( $user_id, $args = array() ) {
if ( ! empty( $args['name'] ) ) { if ( ! empty( $args['name'] ) ) {

View File

@ -91,7 +91,7 @@ class WP_Block_Supports {
* *
* @since 5.6.0 * @since 5.6.0
* *
* @return string[] Array of HTML attributes. * @return string[] Array of HTML attribute values keyed by their name.
*/ */
public function apply_block_supports() { public function apply_block_supports() {
$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block_type = WP_Block_Type_Registry::get_instance()->get_registered(

View File

@ -685,11 +685,11 @@ class WP_Date_Query {
* @since 3.7.0 * @since 3.7.0
* *
* @param array $query Date query arguments. * @param array $query Date query arguments.
* @return string[] { * @return array {
* Array containing JOIN and WHERE SQL clauses to append to the main query. * Array containing JOIN and WHERE SQL clauses to append to the main query.
* *
* @type string $join SQL fragment to append to the main JOIN clause. * @type string[] $join Array of SQL fragments to append to the main JOIN clause.
* @type string $where SQL fragment to append to the main WHERE clause. * @type string[] $where Array of SQL fragments to append to the main WHERE clause.
* } * }
*/ */
protected function get_sql_for_subquery( $query ) { protected function get_sql_for_subquery( $query ) {
@ -705,11 +705,11 @@ class WP_Date_Query {
* *
* @param array $query Date query clause. * @param array $query Date query clause.
* @param array $parent_query Parent query of the current date query. * @param array $parent_query Parent query of the current date query.
* @return string[] { * @return array {
* Array containing JOIN and WHERE SQL clauses to append to the main query. * Array containing JOIN and WHERE SQL clauses to append to the main query.
* *
* @type string $join SQL fragment to append to the main JOIN clause. * @type string[] $join Array of SQL fragments to append to the main JOIN clause.
* @type string $where SQL fragment to append to the main WHERE clause. * @type string[] $where Array of SQL fragments to append to the main WHERE clause.
* } * }
*/ */
protected function get_sql_for_clause( $query, $parent_query ) { protected function get_sql_for_clause( $query, $parent_query ) {

View File

@ -523,11 +523,11 @@ class WP_Meta_Query {
* @param string $clause_key Optional. The array key used to name the clause in the original `$meta_query` * @param string $clause_key Optional. The array key used to name the clause in the original `$meta_query`
* parameters. If not provided, a key will be generated automatically. * parameters. If not provided, a key will be generated automatically.
* Default empty string. * Default empty string.
* @return string[] { * @return array {
* Array containing JOIN and WHERE SQL clauses to append to a first-order query. * Array containing JOIN and WHERE SQL clauses to append to a first-order query.
* *
* @type string $join SQL fragment to append to the main JOIN clause. * @type string[] $join Array of SQL fragments to append to the main JOIN clause.
* @type string $where SQL fragment to append to the main WHERE clause. * @type string[] $where Array of SQL fragments to append to the main WHERE clause.
* } * }
*/ */
public function get_sql_for_clause( &$clause, $parent_query, $clause_key = '' ) { public function get_sql_for_clause( &$clause, $parent_query, $clause_key = '' ) {

View File

@ -374,11 +374,11 @@ class WP_Tax_Query {
* *
* @param array $clause Query clause (passed by reference). * @param array $clause Query clause (passed by reference).
* @param array $parent_query Parent query array. * @param array $parent_query Parent query array.
* @return string[] { * @return array {
* Array containing JOIN and WHERE SQL clauses to append to a first-order query. * Array containing JOIN and WHERE SQL clauses to append to a first-order query.
* *
* @type string $join SQL fragment to append to the main JOIN clause. * @type string[] $join Array of SQL fragments to append to the main JOIN clause.
* @type string $where SQL fragment to append to the main WHERE clause. * @type string[] $where Array of SQL fragments to append to the main WHERE clause.
* } * }
*/ */
public function get_sql_for_clause( &$clause, $parent_query ) { public function get_sql_for_clause( &$clause, $parent_query ) {

View File

@ -67,11 +67,12 @@ class WP_User_Query {
public $query_limit; public $query_limit;
/** /**
* PHP5 constructor. * Constructor.
* *
* @since 3.1.0 * @since 3.1.0
* *
* @param null|string|array $query Optional. The query variables. * @param null|string|array $query Optional. The query variables.
* See WP_User_Query::prepare_query() for information on accepted arguments.
*/ */
public function __construct( $query = null ) { public function __construct( $query = null ) {
if ( ! empty( $query ) ) { if ( ! empty( $query ) ) {
@ -85,7 +86,7 @@ class WP_User_Query {
* *
* @since 4.4.0 * @since 4.4.0
* *
* @param array $args Query vars, as passed to `WP_User_Query`. * @param string|array $args Query vars, as passed to `WP_User_Query`.
* @return array Complete query variables with undefined ones filled in with defaults. * @return array Complete query variables with undefined ones filled in with defaults.
*/ */
public static function fill_query_vars( $args ) { public static function fill_query_vars( $args ) {
@ -147,7 +148,7 @@ class WP_User_Query {
* @global WP_Roles $wp_roles WordPress role management object. * @global WP_Roles $wp_roles WordPress role management object.
* *
* @param string|array $query { * @param string|array $query {
* Optional. Array or string of Query parameters. * Optional. Array or string of query parameters.
* *
* @type int $blog_id The site ID. Default is the current site. * @type int $blog_id The site ID. Default is the current site.
* @type string|string[] $role An array or a comma-separated list of role names that users must match * @type string|string[] $role An array or a comma-separated list of role names that users must match

View File

@ -894,7 +894,7 @@ class WP_User {
* @since 4.9.0 * @since 4.9.0
* *
* @return bool[] List of capabilities keyed by the capability name, * @return bool[] List of capabilities keyed by the capability name,
* e.g. array( 'edit_posts' => true, 'delete_posts' => false ). * e.g. `array( 'edit_posts' => true, 'delete_posts' => false )`.
*/ */
private function get_caps_data() { private function get_caps_data() {
$caps = get_user_meta( $this->ID, $this->cap_key, true ); $caps = get_user_meta( $this->ID, $this->cap_key, true );

View File

@ -1437,12 +1437,12 @@ class wpdb {
/** /**
* Prepares a SQL query for safe execution. * Prepares a SQL query for safe execution.
* *
* Uses sprintf()-like syntax. The following placeholders can be used in the query string: * Uses `sprintf()`-like syntax. The following placeholders can be used in the query string:
* *
* - %d (integer) * - `%d` (integer)
* - %f (float) * - `%f` (float)
* - %s (string) * - `%s` (string)
* - %i (identifier, e.g. table/field names) * - `%i` (identifier, e.g. table/field names)
* *
* All placeholders MUST be left unquoted in the query string. A corresponding argument * All placeholders MUST be left unquoted in the query string. A corresponding argument
* MUST be passed for each placeholder. * MUST be passed for each placeholder.
@ -1477,12 +1477,12 @@ class wpdb {
* from `$args` to `...$args`. * from `$args` to `...$args`.
* @since 6.2.0 Added `%i` for identifiers, e.g. table or field names. * @since 6.2.0 Added `%i` for identifiers, e.g. table or field names.
* Check support via `wpdb::has_cap( 'identifier_placeholders' )`. * Check support via `wpdb::has_cap( 'identifier_placeholders' )`.
* This preserves compatibility with sprintf(), as the C version uses * This preserves compatibility with `sprintf()`, as the C version uses
* `%d` and `$i` as a signed integer, whereas PHP only supports `%d`. * `%d` and `$i` as a signed integer, whereas PHP only supports `%d`.
* *
* @link https://www.php.net/sprintf Description of syntax. * @link https://www.php.net/sprintf Description of syntax.
* *
* @param string $query Query statement with sprintf()-like placeholders. * @param string $query Query statement with `sprintf()`-like placeholders.
* @param array|mixed $args The array of variables to substitute into the query's placeholders * @param array|mixed $args The array of variables to substitute into the query's placeholders
* if being called with an array of arguments, or the first variable * if being called with an array of arguments, or the first variable
* to substitute into the query's placeholders if being called with * to substitute into the query's placeholders if being called with
@ -3319,6 +3319,7 @@ class wpdb {
* *
* @type int $length The column length. * @type int $length The column length.
* @type string $type One of 'byte' or 'char'. * @type string $type One of 'byte' or 'char'.
* }
*/ */
public function get_col_length( $table, $column ) { public function get_col_length( $table, $column ) {
$tablekey = strtolower( $table ); $tablekey = strtolower( $table );

View File

@ -1059,7 +1059,7 @@ function get_comment_pages_count( $comments = null, $per_page = null, $threaded
* @type int|string $max_depth If greater than 1, comment page will be determined * @type int|string $max_depth If greater than 1, comment page will be determined
* for the top-level parent `$comment_id`. * for the top-level parent `$comment_id`.
* Defaults to the value of the 'thread_comments_depth' option. * Defaults to the value of the 'thread_comments_depth' option.
* } * * }
* @return int|null Comment page number or null on error. * @return int|null Comment page number or null on error.
*/ */
function get_page_of_comment( $comment_id, $args = array() ) { function get_page_of_comment( $comment_id, $args = array() ) {

View File

@ -3935,11 +3935,11 @@ function get_shortcut_link() {
} }
/** /**
* Ajax handler for saving a post from Press This. * Ajax handler for saving a post from Press This.
* *
* @since 4.2.0 * @since 4.2.0
* @deprecated 4.9.0 * @deprecated 4.9.0
*/ */
function wp_ajax_press_this_save_post() { function wp_ajax_press_this_save_post() {
_deprecated_function( __FUNCTION__, '4.9.0' ); _deprecated_function( __FUNCTION__, '4.9.0' );
if ( is_plugin_active( 'press-this/press-this-plugin.php' ) ) { if ( is_plugin_active( 'press-this/press-this-plugin.php' ) ) {
@ -3952,11 +3952,11 @@ function wp_ajax_press_this_save_post() {
} }
/** /**
* Ajax handler for creating new category from Press This. * Ajax handler for creating new category from Press This.
* *
* @since 4.2.0 * @since 4.2.0
* @deprecated 4.9.0 * @deprecated 4.9.0
*/ */
function wp_ajax_press_this_add_category() { function wp_ajax_press_this_add_category() {
_deprecated_function( __FUNCTION__, '4.9.0' ); _deprecated_function( __FUNCTION__, '4.9.0' );
if ( is_plugin_active( 'press-this/press-this-plugin.php' ) ) { if ( is_plugin_active( 'press-this/press-this-plugin.php' ) ) {
@ -4446,15 +4446,15 @@ function _get_path_to_translation_from_lang_dir( $domain ) {
} }
/** /**
* Allows multiple block styles. * Allows multiple block styles.
* *
* @since 5.9.0 * @since 5.9.0
* @deprecated 6.1.0 * @deprecated 6.1.0
* *
* @param array $metadata Metadata for registering a block type. * @param array $metadata Metadata for registering a block type.
* @return array Metadata for registering a block type. * @return array Metadata for registering a block type.
*/ */
function _wp_multiple_block_styles( $metadata ) { function _wp_multiple_block_styles( $metadata ) {
_deprecated_function( __FUNCTION__, '6.1.0' ); _deprecated_function( __FUNCTION__, '6.1.0' );
return $metadata; return $metadata;
} }
@ -4598,7 +4598,7 @@ function get_page_by_title( $page_title, $output = OBJECT, $post_type = 'page' )
* @access private * @access private
* @since 6.0.0 * @since 6.0.0
* @deprecated 6.2.0 Site Editor's server-side redirect for missing postType and postId * @deprecated 6.2.0 Site Editor's server-side redirect for missing postType and postId
* query args is removed. Thus, this function is no longer used. * query args is removed. Thus, this function is no longer used.
* *
* @return array|null A template object, or null if none could be found. * @return array|null A template object, or null if none could be found.
*/ */

View File

@ -81,7 +81,7 @@ function _wp_scripts_maybe_doing_it_wrong( $function_name, $handle = '' ) {
* *
* @since 2.1.0 * @since 2.1.0
* *
* @param string|bool|array $handles Optional. Scripts to be printed. Default 'false'. * @param string|string[]|false $handles Optional. Scripts to be printed. Default 'false'.
* @return string[] On success, an array of handles of processed WP_Dependencies items; otherwise, an empty array. * @return string[] On success, an array of handles of processed WP_Dependencies items; otherwise, an empty array.
*/ */
function wp_print_scripts( $handles = false ) { function wp_print_scripts( $handles = false ) {

View File

@ -1225,7 +1225,7 @@ function get_page_statuses() {
* @since 4.9.6 * @since 4.9.6
* @access private * @access private
* *
* @return array * @return string[] Array of privacy request status labels keyed by their status.
*/ */
function _wp_privacy_statuses() { function _wp_privacy_statuses() {
return array( return array(

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.3-alpha-55727'; $wp_version = '6.3-alpha-55732';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.