Docs: Document default values for optional parameters in various DocBlocks.

Props paulkevan, costdev, audrasjb, SergeyBiryukov.
See #56792.
Built from https://develop.svn.wordpress.org/trunk@55398


git-svn-id: http://core.svn.wordpress.org/trunk@54931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-02-21 16:39:19 +00:00
parent 9b806a3114
commit 77dfc892fe
17 changed files with 110 additions and 78 deletions

View File

@ -155,7 +155,7 @@ function the_modified_author() {
* @global WP_User $authordata The current author's data. * @global WP_User $authordata The current author's data.
* *
* @param string $field Optional. The user field to retrieve. Default empty. * @param string $field Optional. The user field to retrieve. Default empty.
* @param int|false $user_id Optional. User ID. * @param int|false $user_id Optional. User ID. Defaults to the current post author.
* @return string The author's field from the current author's DB object, otherwise an empty string. * @return string The author's field from the current author's DB object, otherwise an empty string.
*/ */
function get_the_author_meta( $field = '', $user_id = false ) { function get_the_author_meta( $field = '', $user_id = false ) {
@ -196,7 +196,7 @@ function get_the_author_meta( $field = '', $user_id = false ) {
* *
* @param string $field Selects the field of the users record. See get_the_author_meta() * @param string $field Selects the field of the users record. See get_the_author_meta()
* for the list of possible fields. * for the list of possible fields.
* @param int|false $user_id Optional. User ID. * @param int|false $user_id Optional. User ID. Defaults to the current post author.
* *
* @see get_the_author_meta() * @see get_the_author_meta()
*/ */

View File

@ -71,7 +71,7 @@ function get_bookmark( $bookmark, $output = OBJECT, $filter = 'raw' ) {
* *
* @param string $field The name of the data field to return. * @param string $field The name of the data field to return.
* @param int $bookmark The bookmark ID to get field. * @param int $bookmark The bookmark ID to get field.
* @param string $context Optional. The context of how the field will be used. * @param string $context Optional. The context of how the field will be used. Default 'display'.
* @return string|WP_Error * @return string|WP_Error
*/ */
function get_bookmark_field( $field, $bookmark, $context = 'display' ) { function get_bookmark_field( $field, $bookmark, $context = 'display' ) {

View File

@ -1451,7 +1451,7 @@ final class _WP_Editors {
* *
* @param string $mce_locale The locale used for the editor. * @param string $mce_locale The locale used for the editor.
* @param bool $json_only Optional. Whether to include the JavaScript calls to tinymce.addI18n() and * @param bool $json_only Optional. Whether to include the JavaScript calls to tinymce.addI18n() and
* tinymce.ScriptLoader.markDone(). * tinymce.ScriptLoader.markDone(). Default false.
* @return string Translation object, JSON encoded. * @return string Translation object, JSON encoded.
*/ */
public static function wp_mce_translation( $mce_locale = '', $json_only = false ) { public static function wp_mce_translation( $mce_locale = '', $json_only = false ) {
@ -1751,7 +1751,12 @@ final class _WP_Editors {
* *
* @since 3.1.0 * @since 3.1.0
* *
* @param array $args Optional. Accepts 'pagenum' and 's' (search) arguments. * @param array $args {
* Optional. Array of link query arguments.
*
* @type int $pagenum Page number. Default 1.
* @type string $s Search keywords.
* }
* @return array|false $results { * @return array|false $results {
* An array of associative arrays of query results, false if there are none. * An array of associative arrays of query results, false if there are none.
* *

View File

@ -56,7 +56,7 @@ class WP_Error {
* *
* @param string|int $code Error code. * @param string|int $code Error code.
* @param string $message Error message. * @param string $message Error message.
* @param mixed $data Optional. Error data. * @param mixed $data Optional. Error data. Default empty string.
*/ */
public function __construct( $code = '', $message = '', $data = '' ) { public function __construct( $code = '', $message = '', $data = '' ) {
if ( empty( $code ) ) { if ( empty( $code ) ) {
@ -103,7 +103,8 @@ class WP_Error {
* *
* @since 2.1.0 * @since 2.1.0
* *
* @param string|int $code Optional. Retrieve messages matching code, if exists. * @param string|int $code Optional. Error code to retrieve the messages for.
* Default empty string.
* @return string[] Error strings on success, or empty array if there are none. * @return string[] Error strings on success, or empty array if there are none.
*/ */
public function get_error_messages( $code = '' ) { public function get_error_messages( $code = '' ) {
@ -132,7 +133,8 @@ class WP_Error {
* *
* @since 2.1.0 * @since 2.1.0
* *
* @param string|int $code Optional. Error code to retrieve message. * @param string|int $code Optional. Error code to retrieve the message for.
* Default empty string.
* @return string The error message. * @return string The error message.
*/ */
public function get_error_message( $code = '' ) { public function get_error_message( $code = '' ) {
@ -151,7 +153,7 @@ class WP_Error {
* *
* @since 2.1.0 * @since 2.1.0
* *
* @param string|int $code Optional. Error code. * @param string|int $code Optional. Error code. Default empty string.
* @return mixed Error data, if it exists. * @return mixed Error data, if it exists.
*/ */
public function get_error_data( $code = '' ) { public function get_error_data( $code = '' ) {
@ -185,7 +187,7 @@ class WP_Error {
* *
* @param string|int $code Error code. * @param string|int $code Error code.
* @param string $message Error message. * @param string $message Error message.
* @param mixed $data Optional. Error data. * @param mixed $data Optional. Error data. Default empty string.
*/ */
public function add( $code, $message, $data = '' ) { public function add( $code, $message, $data = '' ) {
$this->errors[ $code ][] = $message; $this->errors[ $code ][] = $message;

View File

@ -345,6 +345,7 @@ class WP_Meta_Query {
* @param string $primary_id_column ID column for the filtered object in $primary_table. * @param string $primary_id_column ID column for the filtered object in $primary_table.
* @param object $context Optional. The main query object that corresponds to the type, for * @param object $context Optional. The main query object that corresponds to the type, for
* example a `WP_Query`, `WP_User_Query`, or `WP_Site_Query`. * example a `WP_Query`, `WP_User_Query`, or `WP_Site_Query`.
* Default null.
* @return string[]|false { * @return string[]|false {
* 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,
* or false if no table exists for the requested meta type. * or false if no table exists for the requested meta type.
@ -521,6 +522,7 @@ class WP_Meta_Query {
* @param array $parent_query Parent query array. * @param array $parent_query Parent query array.
* @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.
* @return string[] { * @return string[] {
* 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.
* *

View File

@ -152,7 +152,7 @@ class WP_Widget {
* *
* @since 2.8.0 * @since 2.8.0
* *
* @param string $id_base Optional. Base ID for the widget, lowercase and unique. If left empty, * @param string $id_base Base ID for the widget, lowercase and unique. If left empty,
* a portion of the widget's PHP class name will be used. Has to be unique. * a portion of the widget's PHP class name will be used. Has to be unique.
* @param string $name Name for the widget displayed on the configuration page. * @param string $name Name for the widget displayed on the configuration page.
* @param array $widget_options Optional. Widget options. See wp_register_sidebar_widget() for * @param array $widget_options Optional. Widget options. See wp_register_sidebar_widget() for
@ -188,7 +188,7 @@ class WP_Widget {
* *
* @see WP_Widget::__construct() * @see WP_Widget::__construct()
* *
* @param string $id_base Optional. Base ID for the widget, lowercase and unique. If left empty, * @param string $id_base Base ID for the widget, lowercase and unique. If left empty,
* a portion of the widget's PHP class name will be used. Has to be unique. * a portion of the widget's PHP class name will be used. Has to be unique.
* @param string $name Name for the widget displayed on the configuration page. * @param string $name Name for the widget displayed on the configuration page.
* @param array $widget_options Optional. Widget options. See wp_register_sidebar_widget() for * @param array $widget_options Optional. Widget options. See wp_register_sidebar_widget() for

View File

@ -1072,7 +1072,7 @@ class wpdb {
* @since 3.0.0 * @since 3.0.0
* *
* @param int $blog_id * @param int $blog_id
* @param int $network_id Optional. * @param int $network_id Optional. Network ID. Default 0.
* @return int Previous blog ID. * @return int Previous blog ID.
*/ */
public function set_blog_id( $blog_id, $network_id = 0 ) { public function set_blog_id( $blog_id, $network_id = 0 ) {
@ -1101,7 +1101,8 @@ class wpdb {
* *
* @since 3.0.0 * @since 3.0.0
* *
* @param int $blog_id Optional. * @param int $blog_id Optional. Blog ID to retrieve the table prefix for.
* Defaults to the current blog ID.
* @return string Blog prefix. * @return string Blog prefix.
*/ */
public function get_blog_prefix( $blog_id = null ) { public function get_blog_prefix( $blog_id = null ) {
@ -1220,7 +1221,8 @@ class wpdb {
* @since 0.71 * @since 0.71
* *
* @param string $db Database name. * @param string $db Database name.
* @param mysqli|resource $dbh Optional database connection. * @param mysqli|resource $dbh Optional. Database connection.
* Defaults to the current database handle.
*/ */
public function select( $db, $dbh = null ) { public function select( $db, $dbh = null ) {
if ( is_null( $dbh ) ) { if ( is_null( $dbh ) ) {
@ -2561,7 +2563,7 @@ class wpdb {
* If string, that format will be used for all of the values in $data. * If string, that format will be used for all of the values in $data.
* A format is one of '%d', '%f', '%s' (integer, float, string). * A format is one of '%d', '%f', '%s' (integer, float, string).
* If omitted, all values in $data will be treated as strings unless otherwise * If omitted, all values in $data will be treated as strings unless otherwise
* specified in wpdb::$field_types. * specified in wpdb::$field_types. Default null.
* @return int|false The number of rows inserted, or false on error. * @return int|false The number of rows inserted, or false on error.
*/ */
public function insert( $table, $data, $format = null ) { public function insert( $table, $data, $format = null ) {
@ -2591,7 +2593,7 @@ class wpdb {
* If string, that format will be used for all of the values in $data. * If string, that format will be used for all of the values in $data.
* A format is one of '%d', '%f', '%s' (integer, float, string). * A format is one of '%d', '%f', '%s' (integer, float, string).
* If omitted, all values in $data will be treated as strings unless otherwise * If omitted, all values in $data will be treated as strings unless otherwise
* specified in wpdb::$field_types. * specified in wpdb::$field_types. Default null.
* @return int|false The number of rows affected, or false on error. * @return int|false The number of rows affected, or false on error.
*/ */
public function replace( $table, $data, $format = null ) { public function replace( $table, $data, $format = null ) {
@ -2618,7 +2620,7 @@ class wpdb {
* If string, that format will be used for all of the values in $data. * If string, that format will be used for all of the values in $data.
* A format is one of '%d', '%f', '%s' (integer, float, string). * A format is one of '%d', '%f', '%s' (integer, float, string).
* If omitted, all values in $data will be treated as strings unless otherwise * If omitted, all values in $data will be treated as strings unless otherwise
* specified in wpdb::$field_types. * specified in wpdb::$field_types. Default null.
* @param string $type Optional. Type of operation. Possible values include 'INSERT' or 'REPLACE'. * @param string $type Optional. Type of operation. Possible values include 'INSERT' or 'REPLACE'.
* Default 'INSERT'. * Default 'INSERT'.
* @return int|false The number of rows affected, or false on error. * @return int|false The number of rows affected, or false on error.
@ -2684,11 +2686,11 @@ class wpdb {
* If string, that format will be used for all of the values in $data. * If string, that format will be used for all of the values in $data.
* A format is one of '%d', '%f', '%s' (integer, float, string). * A format is one of '%d', '%f', '%s' (integer, float, string).
* If omitted, all values in $data will be treated as strings unless otherwise * If omitted, all values in $data will be treated as strings unless otherwise
* specified in wpdb::$field_types. * specified in wpdb::$field_types. Default null.
* @param array|string $where_format Optional. An array of formats to be mapped to each of the values in $where. * @param array|string $where_format Optional. An array of formats to be mapped to each of the values in $where.
* If string, that format will be used for all of the items in $where. * If string, that format will be used for all of the items in $where.
* A format is one of '%d', '%f', '%s' (integer, float, string). * A format is one of '%d', '%f', '%s' (integer, float, string).
* If omitted, all values in $where will be treated as strings. * If omitted, all values in $where will be treated as strings. Default null.
* @return int|false The number of rows updated, or false on error. * @return int|false The number of rows updated, or false on error.
*/ */
public function update( $table, $data, $where, $format = null, $where_format = null ) { public function update( $table, $data, $where, $format = null, $where_format = null ) {
@ -2760,7 +2762,7 @@ class wpdb {
* If string, that format will be used for all of the items in $where. * If string, that format will be used for all of the items in $where.
* A format is one of '%d', '%f', '%s' (integer, float, string). * A format is one of '%d', '%f', '%s' (integer, float, string).
* If omitted, all values in $data will be treated as strings unless otherwise * If omitted, all values in $data will be treated as strings unless otherwise
* specified in wpdb::$field_types. * specified in wpdb::$field_types. Default null.
* @return int|false The number of rows deleted, or false on error. * @return int|false The number of rows deleted, or false on error.
*/ */
public function delete( $table, $where, $where_format = null ) { public function delete( $table, $where, $where_format = null ) {
@ -2967,8 +2969,8 @@ class wpdb {
* @since 0.71 * @since 0.71
* *
* @param string|null $query Optional. SQL query. Defaults to null, use the result from the previous query. * @param string|null $query Optional. SQL query. Defaults to null, use the result from the previous query.
* @param int $x Optional. Column of value to return. Indexed from 0. * @param int $x Optional. Column of value to return. Indexed from 0. Default 0.
* @param int $y Optional. Row of value to return. Indexed from 0. * @param int $y Optional. Row of value to return. Indexed from 0. Default 0.
* @return string|null Database query result (as string), or null on failure. * @return string|null Database query result (as string), or null on failure.
*/ */
public function get_var( $query = null, $x = 0, $y = 0 ) { public function get_var( $query = null, $x = 0, $y = 0 ) {
@ -3002,7 +3004,7 @@ class wpdb {
* @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
* correspond to an stdClass object, an associative array, or a numeric array, * correspond to an stdClass object, an associative array, or a numeric array,
* respectively. Default OBJECT. * respectively. Default OBJECT.
* @param int $y Optional. Row to return. Indexed from 0. * @param int $y Optional. Row to return. Indexed from 0. Default 0.
* @return array|object|null|void Database query result in format specified by $output or null on failure. * @return array|object|null|void Database query result in format specified by $output or null on failure.
*/ */
public function get_row( $query = null, $output = OBJECT, $y = 0 ) { public function get_row( $query = null, $output = OBJECT, $y = 0 ) {
@ -3046,7 +3048,7 @@ class wpdb {
* @since 0.71 * @since 0.71
* *
* @param string|null $query Optional. SQL query. Defaults to previous query. * @param string|null $query Optional. SQL query. Defaults to previous query.
* @param int $x Optional. Column to return. Indexed from 0. * @param int $x Optional. Column to return. Indexed from 0. Default 0.
* @return array Database query result. Array indexed from 0 by SQL result row number. * @return array Database query result. Array indexed from 0 by SQL result row number.
*/ */
public function get_col( $query = null, $x = 0 ) { public function get_col( $query = null, $x = 0 ) {
@ -3083,6 +3085,7 @@ class wpdb {
* or an object ( ->column = value ), respectively. With OBJECT_K, * or an object ( ->column = value ), respectively. With OBJECT_K,
* return an associative array of row objects keyed by the value * return an associative array of row objects keyed by the value
* of each row's first column's value. Duplicate keys are discarded. * of each row's first column's value. Duplicate keys are discarded.
* Default OBJECT.
* @return array|object|null Database query results. * @return array|object|null Database query results.
*/ */
public function get_results( $query = null, $output = OBJECT ) { public function get_results( $query = null, $output = OBJECT ) {

View File

@ -2159,7 +2159,7 @@ function _get_comment_reply_id( $post = null ) {
* @type bool $short_ping Whether to output short pings. Default false. * @type bool $short_ping Whether to output short pings. Default false.
* @type bool $echo Whether to echo the output or return it. Default true. * @type bool $echo Whether to echo the output or return it. Default true.
* } * }
* @param WP_Comment[] $comments Optional. Array of WP_Comment objects. * @param WP_Comment[] $comments Optional. Array of WP_Comment objects. Default null.
* @return void|string Void if 'echo' argument is true, or no comments to list. * @return void|string Void if 'echo' argument is true, or no comments to list.
* Otherwise, HTML list of comments. * Otherwise, HTML list of comments.
*/ */

View File

@ -155,7 +155,13 @@ function check_comment( $author, $email, $url, $comment, $user_ip, $user_agent,
* @since 4.1.0 Refactored to leverage WP_Comment_Query over a direct query. * @since 4.1.0 Refactored to leverage WP_Comment_Query over a direct query.
* *
* @param int $post_id The ID of the post. * @param int $post_id The ID of the post.
* @param array $args Optional. See WP_Comment_Query::__construct() for information on accepted arguments. * @param array $args {
* Optional. See WP_Comment_Query::__construct() for information on accepted arguments.
*
* @type int $status Comment status to limit results by. Defaults to approved comments.
* @type int $post_id Limit results to those affiliated with a given post ID.
* @type string $order How to order retrieved comments. Default 'ASC'.
* }
* @return WP_Comment[]|int[]|int The approved comments, or number of comments if `$count` * @return WP_Comment[]|int[]|int The approved comments, or number of comments if `$count`
* argument is true. * argument is true.
*/ */
@ -236,7 +242,7 @@ function get_comment( $comment = null, $output = OBJECT ) {
* @since 2.7.0 * @since 2.7.0
* *
* @param string|array $args Optional. Array or string of arguments. See WP_Comment_Query::__construct() * @param string|array $args Optional. Array or string of arguments. See WP_Comment_Query::__construct()
* for information on accepted arguments. Default empty. * for information on accepted arguments. Default empty string.
* @return WP_Comment[]|int[]|int List of comments or number of found comments if `$count` argument is true. * @return WP_Comment[]|int[]|int List of comments or number of found comments if `$count` argument is true.
*/ */
function get_comments( $args = '' ) { function get_comments( $args = '' ) {
@ -449,7 +455,7 @@ function add_comment_meta( $comment_id, $meta_key, $meta_value, $unique = false
* @param string $meta_key Metadata name. * @param string $meta_key Metadata name.
* @param mixed $meta_value Optional. Metadata value. If provided, * @param mixed $meta_value Optional. Metadata value. If provided,
* rows will only be removed that match the value. * rows will only be removed that match the value.
* Must be serializable if non-scalar. Default empty. * Must be serializable if non-scalar. Default empty string.
* @return bool True on success, false on failure. * @return bool True on success, false on failure.
*/ */
function delete_comment_meta( $comment_id, $meta_key, $meta_value = '' ) { function delete_comment_meta( $comment_id, $meta_key, $meta_value = '' ) {
@ -465,7 +471,7 @@ function delete_comment_meta( $comment_id, $meta_key, $meta_value = '' ) {
* *
* @param int $comment_id Comment ID. * @param int $comment_id Comment ID.
* @param string $key Optional. The meta key to retrieve. By default, * @param string $key Optional. The meta key to retrieve. By default,
* returns data for all keys. * returns data for all keys. Default empty string.
* @param bool $single Optional. Whether to return a single value. * @param bool $single Optional. Whether to return a single value.
* This parameter has no effect if `$key` is not specified. * This parameter has no effect if `$key` is not specified.
* Default false. * Default false.
@ -495,7 +501,7 @@ function get_comment_meta( $comment_id, $key = '', $single = false ) {
* @param mixed $meta_value Metadata value. Must be serializable if non-scalar. * @param mixed $meta_value Metadata value. Must be serializable if non-scalar.
* @param mixed $prev_value Optional. Previous value to check before updating. * @param mixed $prev_value Optional. Previous value to check before updating.
* If specified, only update existing metadata entries with * If specified, only update existing metadata entries with
* this value. Otherwise, update all entries. Default empty. * this value. Otherwise, update all entries. Default empty string.
* @return int|bool Meta ID if the key didn't exist, true on successful update, * @return int|bool Meta ID if the key didn't exist, true on successful update,
* false on failure or if the value passed to the function * false on failure or if the value passed to the function
* is the same as the one that is already in the database. * is the same as the one that is already in the database.
@ -985,8 +991,10 @@ function separate_comments( &$comments ) {
* @global WP_Query $wp_query WordPress Query object. * @global WP_Query $wp_query WordPress Query object.
* *
* @param WP_Comment[] $comments Optional. Array of WP_Comment objects. Defaults to `$wp_query->comments`. * @param WP_Comment[] $comments Optional. Array of WP_Comment objects. Defaults to `$wp_query->comments`.
* @param int $per_page Optional. Comments per page. * @param int $per_page Optional. Comments per page. Defaults to the value of `comments_per_page`
* @param bool $threaded Optional. Control over flat or threaded comments. * query var, option of the same name, or 1 (in that order).
* @param bool $threaded Optional. Control over flat or threaded comments. Defaults to the value
* of `thread_comments` option.
* @return int Number of comment pages. * @return int Number of comment pages.
*/ */
function get_comment_pages_count( $comments = null, $per_page = null, $threaded = null ) { function get_comment_pages_count( $comments = null, $per_page = null, $threaded = null ) {

View File

@ -1049,7 +1049,7 @@ function build_query( $data ) {
* Default null. * Default null.
* @param string $sep Optional. Argument separator; defaults to 'arg_separator.output'. * @param string $sep Optional. Argument separator; defaults to 'arg_separator.output'.
* Default null. * Default null.
* @param string $key Optional. Used to prefix key name. Default empty. * @param string $key Optional. Used to prefix key name. Default empty string.
* @param bool $urlencode Optional. Whether to use urlencode() in the result. Default true. * @param bool $urlencode Optional. Whether to use urlencode() in the result. Default true.
* @return string The query string. * @return string The query string.
*/ */
@ -1438,6 +1438,7 @@ function get_status_header_desc( $code ) {
* *
* @param int $code HTTP status code. * @param int $code HTTP status code.
* @param string $description Optional. A custom description for the HTTP status. * @param string $description Optional. A custom description for the HTTP status.
* Defaults to the result of get_status_header_desc() for the given code.
*/ */
function status_header( $code, $description = '' ) { function status_header( $code, $description = '' ) {
if ( ! $description ) { if ( ! $description ) {
@ -3000,6 +3001,7 @@ function wp_get_default_extension_for_mime_type( $mime_type ) {
* *
* @param string $filename File name or path. * @param string $filename File name or path.
* @param string[] $mimes Optional. Array of allowed mime types keyed by their file extension regex. * @param string[] $mimes Optional. Array of allowed mime types keyed by their file extension regex.
* Defaults to the result of get_allowed_mime_types().
* @return array { * @return array {
* Values for the extension and mime type. * Values for the extension and mime type.
* *
@ -3042,6 +3044,7 @@ function wp_check_filetype( $filename, $mimes = null ) {
* @param string $filename The name of the file (may differ from $file due to $file being * @param string $filename The name of the file (may differ from $file due to $file being
* in a tmp directory). * in a tmp directory).
* @param string[] $mimes Optional. Array of allowed mime types keyed by their file extension regex. * @param string[] $mimes Optional. Array of allowed mime types keyed by their file extension regex.
* Defaults to the result of get_allowed_mime_types().
* @return array { * @return array {
* Values for the extension, mime type, and corrected filename. * Values for the extension, mime type, and corrected filename.
* *
@ -3618,11 +3621,11 @@ function wp_nonce_ays( $action ) {
* *
* @param string|WP_Error $message Optional. Error message. If this is a WP_Error object, * @param string|WP_Error $message Optional. Error message. If this is a WP_Error object,
* and not an Ajax or XML-RPC request, the error's messages are used. * and not an Ajax or XML-RPC request, the error's messages are used.
* Default empty. * Default empty string.
* @param string|int $title Optional. Error title. If `$message` is a `WP_Error` object, * @param string|int $title Optional. Error title. If `$message` is a `WP_Error` object,
* error data with the key 'title' may be used to specify the title. * error data with the key 'title' may be used to specify the title.
* If `$title` is an integer, then it is treated as the response * If `$title` is an integer, then it is treated as the response code.
* code. Default empty. * Default empty string.
* @param string|array|int $args { * @param string|array|int $args {
* Optional. Arguments to control behavior. If `$args` is an integer, then it is treated * Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
* as the response code. Default empty array. * as the response code. Default empty array.
@ -3725,7 +3728,7 @@ function wp_die( $message = '', $title = '', $args = array() ) {
* @access private * @access private
* *
* @param string|WP_Error $message Error message or WP_Error object. * @param string|WP_Error $message Error message or WP_Error object.
* @param string $title Optional. Error title. Default empty. * @param string $title Optional. Error title. Default empty string.
* @param string|array $args Optional. Arguments to control behavior. Default empty array. * @param string|array $args Optional. Arguments to control behavior. Default empty array.
*/ */
function _default_wp_die_handler( $message, $title = '', $args = array() ) { function _default_wp_die_handler( $message, $title = '', $args = array() ) {
@ -3927,7 +3930,7 @@ function _default_wp_die_handler( $message, $title = '', $args = array() ) {
* @access private * @access private
* *
* @param string $message Error message. * @param string $message Error message.
* @param string $title Optional. Error title (unused). Default empty. * @param string $title Optional. Error title (unused). Default empty string.
* @param string|array $args Optional. Arguments to control behavior. Default empty array. * @param string|array $args Optional. Arguments to control behavior. Default empty array.
*/ */
function _ajax_wp_die_handler( $message, $title = '', $args = array() ) { function _ajax_wp_die_handler( $message, $title = '', $args = array() ) {
@ -3969,7 +3972,7 @@ function _ajax_wp_die_handler( $message, $title = '', $args = array() ) {
* @access private * @access private
* *
* @param string $message Error message. * @param string $message Error message.
* @param string $title Optional. Error title. Default empty. * @param string $title Optional. Error title. Default empty string.
* @param string|array $args Optional. Arguments to control behavior. Default empty array. * @param string|array $args Optional. Arguments to control behavior. Default empty array.
*/ */
function _json_wp_die_handler( $message, $title = '', $args = array() ) { function _json_wp_die_handler( $message, $title = '', $args = array() ) {
@ -4007,7 +4010,7 @@ function _json_wp_die_handler( $message, $title = '', $args = array() ) {
* @access private * @access private
* *
* @param string $message Error message. * @param string $message Error message.
* @param string $title Optional. Error title. Default empty. * @param string $title Optional. Error title. Default empty string.
* @param string|array $args Optional. Arguments to control behavior. Default empty array. * @param string|array $args Optional. Arguments to control behavior. Default empty array.
*/ */
function _jsonp_wp_die_handler( $message, $title = '', $args = array() ) { function _jsonp_wp_die_handler( $message, $title = '', $args = array() ) {
@ -4051,7 +4054,7 @@ function _jsonp_wp_die_handler( $message, $title = '', $args = array() ) {
* @global wp_xmlrpc_server $wp_xmlrpc_server * @global wp_xmlrpc_server $wp_xmlrpc_server
* *
* @param string $message Error message. * @param string $message Error message.
* @param string $title Optional. Error title. Default empty. * @param string $title Optional. Error title. Default empty string.
* @param string|array $args Optional. Arguments to control behavior. Default empty array. * @param string|array $args Optional. Arguments to control behavior. Default empty array.
*/ */
function _xmlrpc_wp_die_handler( $message, $title = '', $args = array() ) { function _xmlrpc_wp_die_handler( $message, $title = '', $args = array() ) {
@ -4081,7 +4084,7 @@ function _xmlrpc_wp_die_handler( $message, $title = '', $args = array() ) {
* @access private * @access private
* *
* @param string $message Error message. * @param string $message Error message.
* @param string $title Optional. Error title. Default empty. * @param string $title Optional. Error title. Default empty string.
* @param string|array $args Optional. Arguments to control behavior. Default empty array. * @param string|array $args Optional. Arguments to control behavior. Default empty array.
*/ */
function _xml_wp_die_handler( $message, $title = '', $args = array() ) { function _xml_wp_die_handler( $message, $title = '', $args = array() ) {
@ -4125,8 +4128,8 @@ EOD;
* @since 5.1.0 Added the $title and $args parameters. * @since 5.1.0 Added the $title and $args parameters.
* @access private * @access private
* *
* @param string $message Optional. Response to print. Default empty. * @param string $message Optional. Response to print. Default empty string.
* @param string $title Optional. Error title (unused). Default empty. * @param string $title Optional. Error title (unused). Default empty string.
* @param string|array $args Optional. Arguments to control behavior. Default empty array. * @param string|array $args Optional. Arguments to control behavior. Default empty array.
*/ */
function _scalar_wp_die_handler( $message = '', $title = '', $args = array() ) { function _scalar_wp_die_handler( $message = '', $title = '', $args = array() ) {
@ -4151,7 +4154,7 @@ function _scalar_wp_die_handler( $message = '', $title = '', $args = array() ) {
* @access private * @access private
* *
* @param string|WP_Error $message Error message or WP_Error object. * @param string|WP_Error $message Error message or WP_Error object.
* @param string $title Optional. Error title. Default empty. * @param string $title Optional. Error title. Default empty string.
* @param string|array $args Optional. Arguments to control behavior. Default empty array. * @param string|array $args Optional. Arguments to control behavior. Default empty array.
* @return array { * @return array {
* Processed arguments. * Processed arguments.
@ -4518,7 +4521,7 @@ function wp_check_jsonp_callback( $callback ) {
* Optional. Options to be used with `json_decode()`. * Optional. Options to be used with `json_decode()`.
* *
* @type bool $associative Optional. When `true`, JSON objects will be returned as associative arrays. * @type bool $associative Optional. When `true`, JSON objects will be returned as associative arrays.
* When `false`, JSON objects will be returned as objects. * When `false`, JSON objects will be returned as objects. Default false.
* } * }
* *
* @return mixed Returns the value encoded in JSON in appropriate PHP type. * @return mixed Returns the value encoded in JSON in appropriate PHP type.
@ -5370,7 +5373,7 @@ function absint( $maybeint ) {
* *
* @param string $function_name The function that was called. * @param string $function_name The function that was called.
* @param string $version The version of WordPress that deprecated the function. * @param string $version The version of WordPress that deprecated the function.
* @param string $replacement Optional. The function that should have been called. Default empty. * @param string $replacement Optional. The function that should have been called. Default empty string.
*/ */
function _deprecated_function( $function_name, $version, $replacement = '' ) { function _deprecated_function( $function_name, $version, $replacement = '' ) {
@ -5556,8 +5559,8 @@ function _deprecated_constructor( $class_name, $version, $parent_class = '' ) {
* @param string $file The file that was included. * @param string $file The file that was included.
* @param string $version The version of WordPress that deprecated the file. * @param string $version The version of WordPress that deprecated the file.
* @param string $replacement Optional. The file that should have been included based on ABSPATH. * @param string $replacement Optional. The file that should have been included based on ABSPATH.
* Default empty. * Default empty string.
* @param string $message Optional. A message regarding the change. Default empty. * @param string $message Optional. A message regarding the change. Default empty string.
*/ */
function _deprecated_file( $file, $version, $replacement = '', $message = '' ) { function _deprecated_file( $file, $version, $replacement = '', $message = '' ) {
@ -5654,7 +5657,7 @@ function _deprecated_file( $file, $version, $replacement = '', $message = '' ) {
* *
* @param string $function_name The function that was called. * @param string $function_name The function that was called.
* @param string $version The version of WordPress that deprecated the argument used. * @param string $version The version of WordPress that deprecated the argument used.
* @param string $message Optional. A message regarding the change. Default empty. * @param string $message Optional. A message regarding the change. Default empty string.
*/ */
function _deprecated_argument( $function_name, $version, $message = '' ) { function _deprecated_argument( $function_name, $version, $message = '' ) {
@ -5742,7 +5745,7 @@ function _deprecated_argument( $function_name, $version, $message = '' ) {
* *
* @param string $hook The hook that was used. * @param string $hook The hook that was used.
* @param string $version The version of WordPress that deprecated the hook. * @param string $version The version of WordPress that deprecated the hook.
* @param string $replacement Optional. The hook that should have been used. Default empty. * @param string $replacement Optional. The hook that should have been used. Default empty string.
* @param string $message Optional. A message regarding the change. Default empty. * @param string $message Optional. A message regarding the change. Default empty.
*/ */
function _deprecated_hook( $hook, $version, $replacement = '', $message = '' ) { function _deprecated_hook( $hook, $version, $replacement = '', $message = '' ) {
@ -5986,7 +5989,7 @@ function iis7_supports_permalinks() {
* @since 1.2.0 * @since 1.2.0
* *
* @param string $file File path. * @param string $file File path.
* @param string[] $allowed_files Optional. Array of allowed files. * @param string[] $allowed_files Optional. Array of allowed files. Default empty array.
* @return int 0 means nothing is wrong, greater than 0 means something was wrong. * @return int 0 means nothing is wrong, greater than 0 means something was wrong.
*/ */
function validate_file( $file, $allowed_files = array() ) { function validate_file( $file, $allowed_files = array() ) {
@ -6104,7 +6107,8 @@ function wp_guess_url() {
* @since 3.3.0 * @since 3.3.0
* *
* @param bool $suspend Optional. Suspends additions if true, re-enables them if false. * @param bool $suspend Optional. Suspends additions if true, re-enables them if false.
* @return bool The current suspend setting * Defaults to not changing the current setting.
* @return bool The current suspend setting.
*/ */
function wp_suspend_cache_addition( $suspend = null ) { function wp_suspend_cache_addition( $suspend = null ) {
static $_suspend = false; static $_suspend = false;
@ -6635,7 +6639,7 @@ function wp_scheduled_delete() {
* @param string $file Absolute path to the file. * @param string $file Absolute path to the file.
* @param array $default_headers List of headers, in the format `array( 'HeaderKey' => 'Header Name' )`. * @param array $default_headers List of headers, in the format `array( 'HeaderKey' => 'Header Name' )`.
* @param string $context Optional. If specified adds filter hook {@see 'extra_$context_headers'}. * @param string $context Optional. If specified adds filter hook {@see 'extra_$context_headers'}.
* Default empty. * Default empty string.
* @return string[] Array of file header values keyed by header name. * @return string[] Array of file header values keyed by header name.
*/ */
function get_file_data( $file, $default_headers, $context = '' ) { function get_file_data( $file, $default_headers, $context = '' ) {
@ -6809,8 +6813,8 @@ function _wp_mysql_week( $column ) {
* @param callable $callback Function that accepts ( ID, $callback_args ) and outputs parent_ID. * @param callable $callback Function that accepts ( ID, $callback_args ) and outputs parent_ID.
* @param int $start The ID to start the loop check at. * @param int $start The ID to start the loop check at.
* @param int $start_parent The parent_ID of $start to use instead of calling $callback( $start ). * @param int $start_parent The parent_ID of $start to use instead of calling $callback( $start ).
* Use null to always use $callback * Use null to always use $callback.
* @param array $callback_args Optional. Additional arguments to send to $callback. * @param array $callback_args Optional. Additional arguments to send to $callback. Default empty array.
* @return array IDs of all members of loop. * @return array IDs of all members of loop.
*/ */
function wp_find_hierarchy_loop( $callback, $start, $start_parent, $callback_args = array() ) { function wp_find_hierarchy_loop( $callback, $start, $start_parent, $callback_args = array() ) {
@ -7813,7 +7817,7 @@ function wp_privacy_anonymize_ip( $ip_addr, $ipv6_fallback = false ) {
* @since 4.9.6 * @since 4.9.6
* *
* @param string $type The type of data to be anonymized. * @param string $type The type of data to be anonymized.
* @param string $data Optional The data to be anonymized. * @param string $data Optional. The data to be anonymized. Default empty string.
* @return string The anonymous data for the requested type. * @return string The anonymous data for the requested type.
*/ */
function wp_privacy_anonymize_data( $type, $data = '' ) { function wp_privacy_anonymize_data( $type, $data = '' ) {
@ -8246,10 +8250,13 @@ function get_dirsize( $directory, $max_execution_time = null ) {
* @param string $directory Full path of a directory. * @param string $directory Full path of a directory.
* @param string|string[] $exclude Optional. Full path of a subdirectory to exclude from the total, * @param string|string[] $exclude Optional. Full path of a subdirectory to exclude from the total,
* or array of paths. Expected without trailing slash(es). * or array of paths. Expected without trailing slash(es).
* Default null.
* @param int $max_execution_time Optional. Maximum time to run before giving up. In seconds. * @param int $max_execution_time Optional. Maximum time to run before giving up. In seconds.
* The timeout is global and is measured from the moment * The timeout is global and is measured from the moment
* WordPress started to load. * WordPress started to load. Defaults to the value of
* `max_execution_time` PHP setting.
* @param array $directory_cache Optional. Array of cached directory paths. * @param array $directory_cache Optional. Array of cached directory paths.
* Defaults to the value of `dirsize_cache` transient.
* @return int|false|null Size in bytes if a valid directory. False if not. Null if timeout. * @return int|false|null Size in bytes if a valid directory. False if not. Null if timeout.
*/ */
function recurse_dirsize( $directory, $exclude = null, $max_execution_time = null, &$directory_cache = null ) { function recurse_dirsize( $directory, $exclude = null, $max_execution_time = null, &$directory_cache = null ) {

View File

@ -171,7 +171,7 @@ function add_metadata( $meta_type, $object_id, $meta_key, $meta_value, $unique =
* @param mixed $meta_value Metadata value. Must be serializable if non-scalar. * @param mixed $meta_value Metadata value. Must be serializable if non-scalar.
* @param mixed $prev_value Optional. Previous value to check before updating. * @param mixed $prev_value Optional. Previous value to check before updating.
* If specified, only update existing metadata entries with * If specified, only update existing metadata entries with
* this value. Otherwise, update all entries. Default empty. * this value. Otherwise, update all entries. Default empty string.
* @return int|bool The new meta field ID if a field with the given key didn't exist * @return int|bool The new meta field ID if a field with the given key didn't exist
* and was therefore added, true on successful update, * and was therefore added, true on successful update,
* false on failure or if the value passed to the function * false on failure or if the value passed to the function
@ -369,6 +369,7 @@ function update_metadata( $meta_type, $object_id, $meta_key, $meta_value, $prev_
* Pass `null`, `false`, or an empty string to skip this check. * Pass `null`, `false`, or an empty string to skip this check.
* (For backward compatibility, it is not possible to pass an empty string * (For backward compatibility, it is not possible to pass an empty string
* to delete those entries with an empty string for a value.) * to delete those entries with an empty string for a value.)
* Default empty string.
* @param bool $delete_all Optional. If true, delete matching metadata entries for all objects, * @param bool $delete_all Optional. If true, delete matching metadata entries for all objects,
* ignoring the specified object_id. Otherwise, only delete * ignoring the specified object_id. Otherwise, only delete
* matching metadata entries for the specified object_id. Default false. * matching metadata entries for the specified object_id. Default false.
@ -558,7 +559,7 @@ function delete_metadata( $meta_type, $object_id, $meta_key, $meta_value = '', $
* or any other object type with an associated meta table. * or any other object type with an associated meta table.
* @param int $object_id ID of the object metadata is for. * @param int $object_id ID of the object metadata is for.
* @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for * @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for
* the specified object. Default empty. * the specified object. Default empty string.
* @param bool $single Optional. If true, return only the first value of the specified `$meta_key`. * @param bool $single Optional. If true, return only the first value of the specified `$meta_key`.
* This parameter has no effect if `$meta_key` is not specified. Default false. * This parameter has no effect if `$meta_key` is not specified. Default false.
* @return mixed An array of values if `$single` is false. * @return mixed An array of values if `$single` is false.
@ -585,7 +586,7 @@ function get_metadata( $meta_type, $object_id, $meta_key = '', $single = false )
* or any other object type with an associated meta table. * or any other object type with an associated meta table.
* @param int $object_id ID of the object metadata is for. * @param int $object_id ID of the object metadata is for.
* @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for * @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for
* the specified object. Default empty. * the specified object. Default empty string.
* @param bool $single Optional. If true, return only the first value of the specified `$meta_key`. * @param bool $single Optional. If true, return only the first value of the specified `$meta_key`.
* This parameter has no effect if `$meta_key` is not specified. Default false. * This parameter has no effect if `$meta_key` is not specified. Default false.
* @return mixed An array of values if `$single` is false. * @return mixed An array of values if `$single` is false.
@ -1230,7 +1231,7 @@ function wp_metadata_lazyloader() {
* @param string $type Type of meta. * @param string $type Type of meta.
* @param string $primary_table Primary database table name. * @param string $primary_table Primary database table name.
* @param string $primary_id_column Primary ID column name. * @param string $primary_id_column Primary ID column name.
* @param object $context Optional. The main query object * @param object $context Optional. The main query object. Default null.
* @return string[]|false { * @return string[]|false {
* 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,
* or false if no table exists for the requested meta type. * or false if no table exists for the requested meta type.
@ -1274,7 +1275,7 @@ function _get_meta_table( $type ) {
* *
* @param string $meta_key Metadata key. * @param string $meta_key Metadata key.
* @param string $meta_type Optional. Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', * @param string $meta_type Optional. Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
* or any other object type with an associated meta table. Default empty. * or any other object type with an associated meta table. Default empty string.
* @return bool Whether the meta key is considered protected. * @return bool Whether the meta key is considered protected.
*/ */
function is_protected_meta( $meta_key, $meta_type = '' ) { function is_protected_meta( $meta_key, $meta_type = '' ) {
@ -1304,7 +1305,7 @@ function is_protected_meta( $meta_key, $meta_type = '' ) {
* @param mixed $meta_value Metadata value to sanitize. * @param mixed $meta_value Metadata value to sanitize.
* @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
* or any other object type with an associated meta table. * or any other object type with an associated meta table.
* @param string $object_subtype Optional. The subtype of the object type. * @param string $object_subtype Optional. The subtype of the object type. Default empty string.
* @return mixed Sanitized $meta_value. * @return mixed Sanitized $meta_value.
*/ */
function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = '' ) { function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = '' ) {
@ -1580,7 +1581,7 @@ function filter_default_metadata( $value, $object_id, $meta_key, $single, $meta_
* @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
* or any other object type with an associated meta table. * or any other object type with an associated meta table.
* @param string $meta_key Metadata key. * @param string $meta_key Metadata key.
* @param string $object_subtype Optional. The subtype of the object type. * @param string $object_subtype Optional. The subtype of the object type. Default empty string.
* @return bool True if the meta key is registered to the object type and, if provided, * @return bool True if the meta key is registered to the object type and, if provided,
* the object subtype. False if not. * the object subtype. False if not.
*/ */
@ -1599,7 +1600,7 @@ function registered_meta_key_exists( $object_type, $meta_key, $object_subtype =
* @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
* or any other object type with an associated meta table. * or any other object type with an associated meta table.
* @param string $meta_key Metadata key. * @param string $meta_key Metadata key.
* @param string $object_subtype Optional. The subtype of the object type. * @param string $object_subtype Optional. The subtype of the object type. Default empty string.
* @return bool True if successful. False if the meta key was not registered. * @return bool True if successful. False if the meta key was not registered.
*/ */
function unregister_meta_key( $object_type, $meta_key, $object_subtype = '' ) { function unregister_meta_key( $object_type, $meta_key, $object_subtype = '' ) {
@ -1648,7 +1649,7 @@ function unregister_meta_key( $object_type, $meta_key, $object_subtype = '' ) {
* *
* @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
* or any other object type with an associated meta table. * or any other object type with an associated meta table.
* @param string $object_subtype Optional. The subtype of the object type. * @param string $object_subtype Optional. The subtype of the object type. Default empty string.
* @return array[] List of registered metadata args, keyed by their meta keys. * @return array[] List of registered metadata args, keyed by their meta keys.
*/ */
function get_registered_meta_keys( $object_type, $object_subtype = '' ) { function get_registered_meta_keys( $object_type, $object_subtype = '' ) {

View File

@ -120,7 +120,7 @@ function get_id_from_blogname( $slug ) {
* @global wpdb $wpdb WordPress database abstraction object. * @global wpdb $wpdb WordPress database abstraction object.
* *
* @param int|string|array $fields Optional. A blog ID, a blog slug, or an array of fields to query against. * @param int|string|array $fields Optional. A blog ID, a blog slug, or an array of fields to query against.
* If not specified the current blog ID is used. * Defaults to the current blog ID.
* @param bool $get_all Whether to retrieve all details or only the details in the blogs table. * @param bool $get_all Whether to retrieve all details or only the details in the blogs table.
* Default is true. * Default is true.
* @return WP_Site|false Blog details on success. False on failure. * @return WP_Site|false Blog details on success. False on failure.
@ -397,7 +397,7 @@ function get_blog_option( $id, $option, $default_value = false ) {
* *
* @param int $id A blog ID. Can be null to refer to the current blog. * @param int $id A blog ID. Can be null to refer to the current blog.
* @param string $option Name of option to add. Expected to not be SQL-escaped. * @param string $option Name of option to add. Expected to not be SQL-escaped.
* @param mixed $value Optional. Option value, can be anything. Expected to not be SQL-escaped. * @param mixed $value Option value, can be anything. Expected to not be SQL-escaped.
* @return bool True if the option was added, false otherwise. * @return bool True if the option was added, false otherwise.
*/ */
function add_blog_option( $id, $option, $value ) { function add_blog_option( $id, $option, $value ) {

View File

@ -330,7 +330,7 @@ function get_blog_permalink( $blog_id, $post_id ) {
* @global wpdb $wpdb WordPress database abstraction object. * @global wpdb $wpdb WordPress database abstraction object.
* *
* @param string $domain Website domain. * @param string $domain Website domain.
* @param string $path Optional. Not required for subdomain installations. * @param string $path Optional. Not required for subdomain installations. Default '/'.
* @return int 0 if no blog found, otherwise the ID of the matching blog. * @return int 0 if no blog found, otherwise the ID of the matching blog.
*/ */
function get_blog_id_from_url( $domain, $path = '/' ) { function get_blog_id_from_url( $domain, $path = '/' ) {
@ -606,6 +606,7 @@ function wpmu_validate_user_signup( $user_name, $user_email ) {
* @param string $blogname The blog name provided by the user. Must be unique. * @param string $blogname The blog name provided by the user. Must be unique.
* @param string $blog_title The blog title provided by the user. * @param string $blog_title The blog title provided by the user.
* @param WP_User|string $user Optional. The user object to check against the new site name. * @param WP_User|string $user Optional. The user object to check against the new site name.
* Default empty string.
* @return array { * @return array {
* Array of domain, path, blog name, blog title, user and error messages. * Array of domain, path, blog name, blog title, user and error messages.
* *
@ -1354,6 +1355,7 @@ function wpmu_create_user( $user_name, $password, $email ) {
* updated. Otherwise, keys and values will be used to set options for * updated. Otherwise, keys and values will be used to set options for
* the new site. Default empty array. * the new site. Default empty array.
* @param int $network_id Optional. Network ID. Only relevant on multi-network installations. * @param int $network_id Optional. Network ID. Only relevant on multi-network installations.
* Default 1.
* @return int|WP_Error Returns WP_Error object on failure, the new site ID on success. * @return int|WP_Error Returns WP_Error object on failure, the new site ID on success.
*/ */
function wpmu_create_blog( $domain, $path, $title, $user_id, $options = array(), $network_id = 1 ) { function wpmu_create_blog( $domain, $path, $title, $user_id, $options = array(), $network_id = 1 ) {
@ -1539,7 +1541,8 @@ Disable these notifications: %3$s'
* *
* @param string $domain The domain to be checked. * @param string $domain The domain to be checked.
* @param string $path The path to be checked. * @param string $path The path to be checked.
* @param int $network_id Optional. Network ID. Relevant only on multi-network installations. * @param int $network_id Optional. Network ID. Only relevant on multi-network installations.
* Default 1.
* @return int|null The site ID if the site name exists, null otherwise. * @return int|null The site ID if the site name exists, null otherwise.
*/ */
function domain_exists( $domain, $path, $network_id = 1 ) { function domain_exists( $domain, $path, $network_id = 1 ) {
@ -1566,7 +1569,7 @@ function domain_exists( $domain, $path, $network_id = 1 ) {
* @param int|null $result The site ID if the site name exists, null otherwise. * @param int|null $result The site ID if the site name exists, null otherwise.
* @param string $domain Domain to be checked. * @param string $domain Domain to be checked.
* @param string $path Path to be checked. * @param string $path Path to be checked.
* @param int $network_id Network ID. Relevant only on multi-network installations. * @param int $network_id Network ID. Only relevant on multi-network installations.
*/ */
return apply_filters( 'domain_exists', $result, $domain, $path, $network_id ); return apply_filters( 'domain_exists', $result, $domain, $path, $network_id );
} }

View File

@ -41,7 +41,7 @@ function get_post_format( $post = null ) {
* *
* @since 3.1.0 * @since 3.1.0
* *
* @param string|string[] $format Optional. The format or formats to check. * @param string|string[] $format Optional. The format or formats to check. Default empty array.
* @param WP_Post|int|null $post Optional. The post to check. Defaults to the current post in the loop. * @param WP_Post|int|null $post Optional. The post to check. Defaults to the current post in the loop.
* @return bool True if the post has any of the given formats (or any format, if no format specified), * @return bool True if the post has any of the given formats (or any format, if no format specified),
* false otherwise. * false otherwise.

View File

@ -260,7 +260,7 @@ function wp_save_post_revision( $post_id ) {
* @global wpdb $wpdb WordPress database abstraction object. * @global wpdb $wpdb WordPress database abstraction object.
* *
* @param int $post_id The post ID. * @param int $post_id The post ID.
* @param int $user_id Optional. The post author ID. * @param int $user_id Optional. The post author ID. Default 0.
* @return WP_Post|false The autosaved data or false on failure or when no autosave exists. * @return WP_Post|false The autosaved data or false on failure or when no autosave exists.
*/ */
function wp_get_post_autosave( $post_id, $user_id = 0 ) { function wp_get_post_autosave( $post_id, $user_id = 0 ) {
@ -343,6 +343,7 @@ function wp_is_post_autosave( $post ) {
* *
* @param int|WP_Post|array|null $post Post ID, post object OR post array. * @param int|WP_Post|array|null $post Post ID, post object OR post array.
* @param bool $autosave Optional. Whether the revision is an autosave or not. * @param bool $autosave Optional. Whether the revision is an autosave or not.
* Default false.
* @return int|WP_Error WP_Error or 0 if error, new revision ID if success. * @return int|WP_Error WP_Error or 0 if error, new revision ID if success.
*/ */
function _wp_put_post_revision( $post = null, $autosave = false ) { function _wp_put_post_revision( $post = null, $autosave = false ) {
@ -391,7 +392,7 @@ function _wp_put_post_revision( $post = null, $autosave = false ) {
* @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
* correspond to a WP_Post object, an associative array, or a numeric array, * correspond to a WP_Post object, an associative array, or a numeric array,
* respectively. Default OBJECT. * respectively. Default OBJECT.
* @param string $filter Optional sanitization filter. See sanitize_post(). * @param string $filter Optional sanitization filter. See sanitize_post(). Default 'raw'.
* @return WP_Post|array|null WP_Post (or array) on success, or null on failure. * @return WP_Post|array|null WP_Post (or array) on success, or null on failure.
*/ */
function wp_get_post_revision( &$post, $output = OBJECT, $filter = 'raw' ) { function wp_get_post_revision( &$post, $output = OBJECT, $filter = 'raw' ) {

View File

@ -541,7 +541,7 @@ endif;
* @subpackage MagpieRSS * @subpackage MagpieRSS
* *
* @param string $url URL to retrieve * @param string $url URL to retrieve
* @param array $headers Optional. Headers to send to the URL. * @param array $headers Optional. Headers to send to the URL. Default empty string.
* @return Snoopy style response * @return Snoopy style response
*/ */
function _fetch_remote_file($url, $headers = "" ) { function _fetch_remote_file($url, $headers = "" ) {

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.2-beta2-55397'; $wp_version = '6.2-beta2-55398';
/** /**
* 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.