Docs: Improve docs for upload and `wp_die()` related functions.

See #47110 

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


git-svn-id: http://core.svn.wordpress.org/trunk@45974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2019-09-17 21:03:54 +00:00
parent 5a477b5715
commit b4ac30c19c
2 changed files with 32 additions and 17 deletions

View File

@ -2158,7 +2158,7 @@ function wp_get_upload_dir() {
} }
/** /**
* Get an array containing the current upload directory's path and url. * Returns an array containing the current upload directory's path and URL.
* *
* Checks the 'upload_path' option, which should be from the web root folder, * Checks the 'upload_path' option, which should be from the web root folder,
* and if it isn't empty it will be used. If it is empty, then the path will be * and if it isn't empty it will be used. If it is empty, then the path will be
@ -2176,14 +2176,6 @@ function wp_get_upload_dir() {
* 'error' containing the error message. The error suggests that the parent * 'error' containing the error message. The error suggests that the parent
* directory is not writable by the server. * directory is not writable by the server.
* *
* On success, the returned array will have many indices:
* 'path' - base directory and sub directory or full path to upload directory.
* 'url' - base url and sub directory or absolute URL to upload directory.
* 'subdir' - sub directory if uploads use year/month folders option is on.
* 'basedir' - path without subdir.
* 'baseurl' - URL path without subdir.
* 'error' - false or error message.
*
* @since 2.0.0 * @since 2.0.0
* @uses _wp_upload_dir() * @uses _wp_upload_dir()
* *
@ -2194,7 +2186,16 @@ function wp_get_upload_dir() {
* @param bool $create_dir Optional. Whether to check and create the uploads directory. * @param bool $create_dir Optional. Whether to check and create the uploads directory.
* Default true for backward compatibility. * Default true for backward compatibility.
* @param bool $refresh_cache Optional. Whether to refresh the cache. Default false. * @param bool $refresh_cache Optional. Whether to refresh the cache. Default false.
* @return array See above for description. * @return array {
* Array of information about the upload directory.
*
* @type string $path Base directory and subdirectory or full path to upload directory.
* @type string $url Base URL and subdirectory or absolute URL to upload directory.
* @type string $subdir Subdirectory if uploads use year/month folders option is on.
* @type string $basedir Path without subdir.
* @type string $baseurl URL path without subdir.
* @type string|false $error False or error message.
* }
*/ */
function wp_upload_dir( $time = null, $create_dir = true, $refresh_cache = false ) { function wp_upload_dir( $time = null, $create_dir = true, $refresh_cache = false ) {
static $cache = array(), $tested_paths = array(); static $cache = array(), $tested_paths = array();
@ -2210,8 +2211,16 @@ function wp_upload_dir( $time = null, $create_dir = true, $refresh_cache = false
* *
* @since 2.0.0 * @since 2.0.0
* *
* @param array $uploads Array of upload directory data with keys of 'path', * @param array $uploads {
* 'url', 'subdir, 'basedir', and 'error'. * Array of information about the upload directory.
*
* @type string $path Base directory and subdirectory or full path to upload directory.
* @type string $url Base URL and subdirectory or absolute URL to upload directory.
* @type string $subdir Subdirectory if uploads use year/month folders option is on.
* @type string $basedir Path without subdir.
* @type string $baseurl URL path without subdir.
* @type string|false $error False or error message.
* }
*/ */
$uploads = apply_filters( 'upload_dir', $cache[ $key ] ); $uploads = apply_filters( 'upload_dir', $cache[ $key ] );
@ -3611,10 +3620,16 @@ function _scalar_wp_die_handler( $message = '', $title = '', $args = array() ) {
* @since 5.1.0 * @since 5.1.0
* @access private * @access private
* *
* @param string $message Error message. * @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.
* @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 List of processed $message string, $title string, and $args array. * @return array {
* Processed arguments.
*
* @type string $0 Error message.
* @type string $1 Error title.
* @type array $2 Arguments to control behavior.
* }
*/ */
function _wp_die_process_input( $message, $title = '', $args = array() ) { function _wp_die_process_input( $message, $title = '', $args = array() ) {
$defaults = array( $defaults = array(

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.3-alpha-46161'; $wp_version = '5.3-alpha-46162';
/** /**
* 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.