Improve various `@param` docs.
See #30224. git-svn-id: https://develop.svn.wordpress.org/trunk@30674 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ee388b9852
commit
0632a3de68
|
@ -197,7 +197,7 @@ function number_format_i18n( $number, $decimals = 0 ) {
|
||||||
*
|
*
|
||||||
* @param int|string $bytes Number of bytes. Note max integer size for integers.
|
* @param int|string $bytes Number of bytes. Note max integer size for integers.
|
||||||
* @param int $decimals Optional. Precision of number of decimal places. Default 0.
|
* @param int $decimals Optional. Precision of number of decimal places. Default 0.
|
||||||
* @return bool|string False on failure. Number string on success.
|
* @return string|false False on failure. Number string on success.
|
||||||
*/
|
*/
|
||||||
function size_format( $bytes, $decimals = 0 ) {
|
function size_format( $bytes, $decimals = 0 ) {
|
||||||
$quant = array(
|
$quant = array(
|
||||||
|
@ -641,7 +641,7 @@ function wp_get_http_headers( $url, $deprecated = false ) {
|
||||||
* @global string $currentday The day of the current post in the loop.
|
* @global string $currentday The day of the current post in the loop.
|
||||||
* @global string $previousday The day of the previous post in the loop.
|
* @global string $previousday The day of the previous post in the loop.
|
||||||
*
|
*
|
||||||
* @return int|bool 1|true when new day, 0|false if not a new day.
|
* @return int 1 when new day, 0 if not a new day.
|
||||||
*/
|
*/
|
||||||
function is_new_day() {
|
function is_new_day() {
|
||||||
global $currentday, $previousday;
|
global $currentday, $previousday;
|
||||||
|
@ -842,7 +842,7 @@ function add_magic_quotes( $array ) {
|
||||||
* @see wp_safe_remote_get()
|
* @see wp_safe_remote_get()
|
||||||
*
|
*
|
||||||
* @param string $uri URI/URL of web page to retrieve.
|
* @param string $uri URI/URL of web page to retrieve.
|
||||||
* @return bool|string HTTP content. False on failure.
|
* @return false|string HTTP content. False on failure.
|
||||||
*/
|
*/
|
||||||
function wp_remote_fopen( $uri ) {
|
function wp_remote_fopen( $uri ) {
|
||||||
$parsed_url = @parse_url( $uri );
|
$parsed_url = @parse_url( $uri );
|
||||||
|
@ -1327,9 +1327,9 @@ function is_blog_installed() {
|
||||||
*
|
*
|
||||||
* @since 2.0.4
|
* @since 2.0.4
|
||||||
*
|
*
|
||||||
* @param string $actionurl URL to add nonce action.
|
* @param string $actionurl URL to add nonce action.
|
||||||
* @param string $action Optional. Nonce action name. Default -1.
|
* @param int|string $action Optional. Nonce action name. Default -1.
|
||||||
* @param string $name Optional. Nonce name. Default '_wpnonce'.
|
* @param string $name Optional. Nonce name. Default '_wpnonce'.
|
||||||
* @return string Escaped URL with nonce action added.
|
* @return string Escaped URL with nonce action added.
|
||||||
*/
|
*/
|
||||||
function wp_nonce_url( $actionurl, $action = -1, $name = '_wpnonce' ) {
|
function wp_nonce_url( $actionurl, $action = -1, $name = '_wpnonce' ) {
|
||||||
|
@ -1357,10 +1357,10 @@ function wp_nonce_url( $actionurl, $action = -1, $name = '_wpnonce' ) {
|
||||||
*
|
*
|
||||||
* @since 2.0.4
|
* @since 2.0.4
|
||||||
*
|
*
|
||||||
* @param string $action Optional. Action name. Default -1.
|
* @param int|string $action Optional. Action name. Default -1.
|
||||||
* @param string $name Optional. Nonce name. Default '_wpnonce'.
|
* @param string $name Optional. Nonce name. Default '_wpnonce'.
|
||||||
* @param bool $referer Optional. Whether to set the referer field for validation. Default true.
|
* @param bool $referer Optional. Whether to set the referer field for validation. Default true.
|
||||||
* @param bool $echo Optional. Whether to display or return hidden form field. Default true.
|
* @param bool $echo Optional. Whether to display or return hidden form field. Default true.
|
||||||
* @return string Nonce field HTML markup.
|
* @return string Nonce field HTML markup.
|
||||||
*/
|
*/
|
||||||
function wp_nonce_field( $action = -1, $name = "_wpnonce", $referer = true , $echo = true ) {
|
function wp_nonce_field( $action = -1, $name = "_wpnonce", $referer = true , $echo = true ) {
|
||||||
|
@ -1426,7 +1426,7 @@ function wp_original_referer_field( $echo = true, $jump_back_to = 'current' ) {
|
||||||
*
|
*
|
||||||
* @since 2.0.4
|
* @since 2.0.4
|
||||||
*
|
*
|
||||||
* @return string|bool False on failure. Referer URL on success.
|
* @return false|string False on failure. Referer URL on success.
|
||||||
*/
|
*/
|
||||||
function wp_get_referer() {
|
function wp_get_referer() {
|
||||||
if ( ! function_exists( 'wp_validate_redirect' ) )
|
if ( ! function_exists( 'wp_validate_redirect' ) )
|
||||||
|
@ -1447,7 +1447,7 @@ function wp_get_referer() {
|
||||||
*
|
*
|
||||||
* @since 2.0.4
|
* @since 2.0.4
|
||||||
*
|
*
|
||||||
* @return string|bool False if no original referer or original referer if set.
|
* @return string|false False if no original referer or original referer if set.
|
||||||
*/
|
*/
|
||||||
function wp_get_original_referer() {
|
function wp_get_original_referer() {
|
||||||
if ( ! empty( $_REQUEST['_wp_original_http_referer'] ) && function_exists( 'wp_validate_redirect' ) )
|
if ( ! empty( $_REQUEST['_wp_original_http_referer'] ) && function_exists( 'wp_validate_redirect' ) )
|
||||||
|
@ -1918,10 +1918,10 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null )
|
||||||
*
|
*
|
||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
*
|
*
|
||||||
* @param string $name Filename.
|
* @param string $name Filename.
|
||||||
* @param null $deprecated Never used. Set to null.
|
* @param null|string $deprecated Never used. Set to null.
|
||||||
* @param mixed $bits File content
|
* @param mixed $bits File content
|
||||||
* @param string $time Optional. Time formatted in 'yyyy/mm'. Default null.
|
* @param string $time Optional. Time formatted in 'yyyy/mm'. Default null.
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function wp_upload_bits( $name, $deprecated, $bits, $time = null ) {
|
function wp_upload_bits( $name, $deprecated, $bits, $time = null ) {
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*
|
*
|
||||||
* @since 2.6.0
|
* @since 2.6.0
|
||||||
*
|
*
|
||||||
* @param array|bool $handles Optional. Scripts to be printed. Default 'false'.
|
* @param string|bool|array $handles Optional. Scripts to be printed. Default 'false'.
|
||||||
* @return array On success, a processed array of WP_Dependencies items; otherwise, an empty array.
|
* @return array On success, a processed array of WP_Dependencies items; otherwise, an empty array.
|
||||||
*/
|
*/
|
||||||
function wp_print_scripts( $handles = false ) {
|
function wp_print_scripts( $handles = false ) {
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
* @since 2.6.0
|
* @since 2.6.0
|
||||||
*
|
*
|
||||||
* @param array|bool $handles Styles to be printed. Default 'false'.
|
* @param string|bool|array $handles Styles to be printed. Default 'false'.
|
||||||
* @return array On success, a processed array of WP_Dependencies items; otherwise, an empty array.
|
* @return array On success, a processed array of WP_Dependencies items; otherwise, an empty array.
|
||||||
*/
|
*/
|
||||||
function wp_print_styles( $handles = false ) {
|
function wp_print_styles( $handles = false ) {
|
||||||
|
@ -236,7 +236,7 @@ function wp_style_is( $handle, $list = 'enqueued' ) {
|
||||||
* @param string $handle Name of the stylesheet.
|
* @param string $handle Name of the stylesheet.
|
||||||
* @param string $key Name of data point for which we're storing a value.
|
* @param string $key Name of data point for which we're storing a value.
|
||||||
* Accepts 'conditional', 'rtl' and 'suffix', 'alt' and 'title'.
|
* Accepts 'conditional', 'rtl' and 'suffix', 'alt' and 'title'.
|
||||||
* @param mixed $data String containing the CSS data to be added.
|
* @param mixed $value String containing the CSS data to be added.
|
||||||
* @return bool True on success, false on failure.
|
* @return bool True on success, false on failure.
|
||||||
*/
|
*/
|
||||||
function wp_style_add_data( $handle, $key, $value ) {
|
function wp_style_add_data( $handle, $key, $value ) {
|
||||||
|
|
|
@ -1858,7 +1858,7 @@ function the_date( $d = '', $before = '', $after = '', $echo = true ) {
|
||||||
*
|
*
|
||||||
* @param string $d Optional. PHP date format defaults to the date_format option if not specified.
|
* @param string $d Optional. PHP date format defaults to the date_format option if not specified.
|
||||||
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post.
|
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post.
|
||||||
* @return string|bool Date the current post was written. False on failure.
|
* @return false|string Date the current post was written. False on failure.
|
||||||
*/
|
*/
|
||||||
function get_the_date( $d = '', $post = null ) {
|
function get_the_date( $d = '', $post = null ) {
|
||||||
$post = get_post( $post );
|
$post = get_post( $post );
|
||||||
|
@ -1976,7 +1976,7 @@ function the_time( $d = '' ) {
|
||||||
* was written. Either 'G', 'U', or php date format defaults
|
* was written. Either 'G', 'U', or php date format defaults
|
||||||
* to the value specified in the time_format option. Default empty.
|
* to the value specified in the time_format option. Default empty.
|
||||||
* @param int|WP_Post $post WP_Post object or ID. Default is global $post object.
|
* @param int|WP_Post $post WP_Post object or ID. Default is global $post object.
|
||||||
* @return string|int|bool Formatted date string or Unix timestamp. False on failure.
|
* @return false|string Formatted date string or Unix timestamp. False on failure.
|
||||||
*/
|
*/
|
||||||
function get_the_time( $d = '', $post = null ) {
|
function get_the_time( $d = '', $post = null ) {
|
||||||
$post = get_post($post);
|
$post = get_post($post);
|
||||||
|
@ -2014,7 +2014,7 @@ function get_the_time( $d = '', $post = null ) {
|
||||||
* @param bool $gmt Optional. Whether to retrieve the GMT time. Default false.
|
* @param bool $gmt Optional. Whether to retrieve the GMT time. Default false.
|
||||||
* @param int|WP_Post $post WP_Post object or ID. Default is global $post object.
|
* @param int|WP_Post $post WP_Post object or ID. Default is global $post object.
|
||||||
* @param bool $translate Whether to translate the time string. Default false.
|
* @param bool $translate Whether to translate the time string. Default false.
|
||||||
* @return string|int|bool Formatted date string or Unix timestamp. False on failure.
|
* @return false|string Formatted date string or Unix timestamp. False on failure.
|
||||||
*/
|
*/
|
||||||
function get_post_time( $d = 'U', $gmt = false, $post = null, $translate = false ) {
|
function get_post_time( $d = 'U', $gmt = false, $post = null, $translate = false ) {
|
||||||
$post = get_post($post);
|
$post = get_post($post);
|
||||||
|
@ -2101,7 +2101,7 @@ function get_the_modified_time($d = '') {
|
||||||
* @param bool $gmt Optional. Whether to retrieve the GMT time. Default false.
|
* @param bool $gmt Optional. Whether to retrieve the GMT time. Default false.
|
||||||
* @param int|WP_Post $post WP_Post object or ID. Default is global $post object.
|
* @param int|WP_Post $post WP_Post object or ID. Default is global $post object.
|
||||||
* @param bool $translate Whether to translate the time string. Default false.
|
* @param bool $translate Whether to translate the time string. Default false.
|
||||||
* @return string|int|bool Formatted date string or Unix timestamp. False on failure.
|
* @return false|string Formatted date string or Unix timestamp. False on failure.
|
||||||
*/
|
*/
|
||||||
function get_post_modified_time( $d = 'U', $gmt = false, $post = null, $translate = false ) {
|
function get_post_modified_time( $d = 'U', $gmt = false, $post = null, $translate = false ) {
|
||||||
$post = get_post($post);
|
$post = get_post($post);
|
||||||
|
|
|
@ -381,8 +381,8 @@ function get_allowed_http_origins() {
|
||||||
*
|
*
|
||||||
* @since 3.4.0
|
* @since 3.4.0
|
||||||
*
|
*
|
||||||
* @param string Origin URL. If not provided, the value of get_http_origin() is used.
|
* @param null|string $origin Origin URL. If not provided, the value of get_http_origin() is used.
|
||||||
* @return bool True if the origin is allowed. False otherwise.
|
* @return bool|null True if the origin is allowed. False otherwise.
|
||||||
*/
|
*/
|
||||||
function is_allowed_http_origin( $origin = null ) {
|
function is_allowed_http_origin( $origin = null ) {
|
||||||
$origin_arg = $origin;
|
$origin_arg = $origin;
|
||||||
|
@ -441,7 +441,8 @@ function send_origin_headers() {
|
||||||
*
|
*
|
||||||
* @since 3.5.2
|
* @since 3.5.2
|
||||||
*
|
*
|
||||||
* @return mixed URL or false on failure.
|
* @param string $url
|
||||||
|
* @return false|string URL or false on failure.
|
||||||
*/
|
*/
|
||||||
function wp_http_validate_url( $url ) {
|
function wp_http_validate_url( $url ) {
|
||||||
$original_url = $url;
|
$original_url = $url;
|
||||||
|
|
|
@ -389,6 +389,11 @@ function _n_noop( $singular, $plural, $domain = null ) {
|
||||||
* Register plural strings with context in POT file, but don't translate them.
|
* Register plural strings with context in POT file, but don't translate them.
|
||||||
*
|
*
|
||||||
* @since 2.8.0
|
* @since 2.8.0
|
||||||
|
* @param string $singular
|
||||||
|
* @param string $plural
|
||||||
|
* @param string $context
|
||||||
|
* @param string|null $domain
|
||||||
|
* @return array
|
||||||
*/
|
*/
|
||||||
function _nx_noop( $singular, $plural, $context, $domain = null ) {
|
function _nx_noop( $singular, $plural, $context, $domain = null ) {
|
||||||
return array( 0 => $singular, 1 => $plural, 2 => $context, 'singular' => $singular, 'plural' => $plural, 'context' => $context, 'domain' => $domain );
|
return array( 0 => $singular, 1 => $plural, 2 => $context, 'singular' => $singular, 'plural' => $plural, 'context' => $context, 'domain' => $domain );
|
||||||
|
@ -700,7 +705,7 @@ function load_child_theme_textdomain( $domain, $path = false ) {
|
||||||
* @since 2.8.0
|
* @since 2.8.0
|
||||||
*
|
*
|
||||||
* @param string $domain Text domain. Unique identifier for retrieving translated strings.
|
* @param string $domain Text domain. Unique identifier for retrieving translated strings.
|
||||||
* @return Translations A Translations instance.
|
* @return NOOP_Translations A Translations instance.
|
||||||
*/
|
*/
|
||||||
function get_translations_for_domain( $domain ) {
|
function get_translations_for_domain( $domain ) {
|
||||||
global $l10n;
|
global $l10n;
|
||||||
|
|
|
@ -2037,7 +2037,7 @@ function get_taxonomies_for_attachments( $output = 'names' ) {
|
||||||
*
|
*
|
||||||
* @param int $width Image width
|
* @param int $width Image width
|
||||||
* @param int $height Image height
|
* @param int $height Image height
|
||||||
* @return image resource
|
* @return resource resource
|
||||||
*/
|
*/
|
||||||
function wp_imagecreatetruecolor($width, $height) {
|
function wp_imagecreatetruecolor($width, $height) {
|
||||||
$img = imagecreatetruecolor($width, $height);
|
$img = imagecreatetruecolor($width, $height);
|
||||||
|
@ -2053,6 +2053,12 @@ function wp_imagecreatetruecolor($width, $height) {
|
||||||
*
|
*
|
||||||
* @since 2.9.0
|
* @since 2.9.0
|
||||||
* @see WP_Embed::register_handler()
|
* @see WP_Embed::register_handler()
|
||||||
|
*
|
||||||
|
* @global WP_Embed $wp_embed
|
||||||
|
* @param string $id
|
||||||
|
* @param string $regex
|
||||||
|
* @param callable $callback
|
||||||
|
* @param int $priority
|
||||||
*/
|
*/
|
||||||
function wp_embed_register_handler( $id, $regex, $callback, $priority = 10 ) {
|
function wp_embed_register_handler( $id, $regex, $callback, $priority = 10 ) {
|
||||||
global $wp_embed;
|
global $wp_embed;
|
||||||
|
@ -2064,6 +2070,10 @@ function wp_embed_register_handler( $id, $regex, $callback, $priority = 10 ) {
|
||||||
*
|
*
|
||||||
* @since 2.9.0
|
* @since 2.9.0
|
||||||
* @see WP_Embed::unregister_handler()
|
* @see WP_Embed::unregister_handler()
|
||||||
|
*
|
||||||
|
* @global WP_Embed $wp_embed
|
||||||
|
* @param string $id
|
||||||
|
* @param int $priority
|
||||||
*/
|
*/
|
||||||
function wp_embed_unregister_handler( $id, $priority = 10 ) {
|
function wp_embed_unregister_handler( $id, $priority = 10 ) {
|
||||||
global $wp_embed;
|
global $wp_embed;
|
||||||
|
@ -2135,7 +2145,7 @@ function wp_expand_dimensions( $example_width, $example_height, $max_width, $max
|
||||||
*
|
*
|
||||||
* @param string $url The URL that should be embedded.
|
* @param string $url The URL that should be embedded.
|
||||||
* @param array $args Additional arguments and parameters.
|
* @param array $args Additional arguments and parameters.
|
||||||
* @return bool|string False on failure or the embed HTML on success.
|
* @return false|string False on failure or the embed HTML on success.
|
||||||
*/
|
*/
|
||||||
function wp_oembed_get( $url, $args = '' ) {
|
function wp_oembed_get( $url, $args = '' ) {
|
||||||
require_once( ABSPATH . WPINC . '/class-oembed.php' );
|
require_once( ABSPATH . WPINC . '/class-oembed.php' );
|
||||||
|
|
|
@ -1539,7 +1539,8 @@ function _get_meta_table($type) {
|
||||||
*
|
*
|
||||||
* @since 3.1.3
|
* @since 3.1.3
|
||||||
*
|
*
|
||||||
* @param string $meta_key Meta key
|
* @param string $meta_key Meta key
|
||||||
|
* @param string|null $meta_type
|
||||||
* @return bool True if the key is protected, false otherwise.
|
* @return bool True if the key is protected, false otherwise.
|
||||||
*/
|
*/
|
||||||
function is_protected_meta( $meta_key, $meta_type = null ) {
|
function is_protected_meta( $meta_key, $meta_type = null ) {
|
||||||
|
@ -1595,7 +1596,6 @@ function sanitize_meta( $meta_key, $meta_value, $meta_type ) {
|
||||||
* @param string $meta_key Meta key
|
* @param string $meta_key Meta key
|
||||||
* @param string|array $sanitize_callback A function or method to call when sanitizing the value of $meta_key.
|
* @param string|array $sanitize_callback A function or method to call when sanitizing the value of $meta_key.
|
||||||
* @param string|array $auth_callback Optional. A function or method to call when performing edit_post_meta, add_post_meta, and delete_post_meta capability checks.
|
* @param string|array $auth_callback Optional. A function or method to call when performing edit_post_meta, add_post_meta, and delete_post_meta capability checks.
|
||||||
* @param array $args Arguments
|
|
||||||
*/
|
*/
|
||||||
function register_meta( $meta_type, $meta_key, $sanitize_callback, $auth_callback = null ) {
|
function register_meta( $meta_type, $meta_key, $sanitize_callback, $auth_callback = null ) {
|
||||||
if ( is_callable( $sanitize_callback ) )
|
if ( is_callable( $sanitize_callback ) )
|
||||||
|
|
|
@ -2024,7 +2024,6 @@ function is_user_spammy( $user = null ) {
|
||||||
*
|
*
|
||||||
* @param int $old_value
|
* @param int $old_value
|
||||||
* @param int $value The new public value
|
* @param int $value The new public value
|
||||||
* @return bool
|
|
||||||
*/
|
*/
|
||||||
function update_blog_public( $old_value, $value ) {
|
function update_blog_public( $old_value, $value ) {
|
||||||
update_blog_status( get_current_blog_id(), 'public', (int) $value );
|
update_blog_status( get_current_blog_id(), 'public', (int) $value );
|
||||||
|
|
Loading…
Reference in New Issue