Docs: Switch more docs over to typed array notation, plus some fixes.

See #48303, #41756

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


git-svn-id: http://core.svn.wordpress.org/trunk@46393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2019-10-26 21:09:04 +00:00
parent 9890e68661
commit 3caaa40fc6
36 changed files with 218 additions and 212 deletions

View File

@ -59,8 +59,8 @@ $preload_paths = array(
*
* @since 5.0.0
*
* @param array $preload_paths Array of paths to preload.
* @param object $post The post resource data.
* @param string[] $preload_paths Array of paths to preload.
* @param WP_Post $post Post being edited.
*/
$preload_paths = apply_filters( 'block_editor_preload_paths', $preload_paths, $post );

View File

@ -378,10 +378,10 @@ class WP_MS_Users_List_Table extends WP_List_Table {
*
* @since 5.2.0
*
* @param array $site_classes Class used within the span tag. Default "site-#" with the site's network ID.
* @param string[] $site_classes Array of class names used within the span tag. Default "site-#" with the site's network ID.
* @param int $site_id Site ID.
* @param int $network_id Network ID.
* @param object $user WP_User object.
* @param WP_User $user WP_User object.
*/
$site_classes = apply_filters( 'ms_user_list_site_class', $site_classes, $val->userblog_id, $val->site_id, $user );
if ( is_array( $site_classes ) && ! empty( $site_classes ) ) {

View File

@ -1208,9 +1208,9 @@ class WP_Posts_List_Table extends WP_List_Table {
*
* @since 5.2.0
*
* @param array $term_links List of links to edit.php, filtered by the taxonomy term.
* @param string[] $term_links Array of term editing links.
* @param string $taxonomy Taxonomy name.
* @param array $terms Array of terms appearing in the post row.
* @param WP_Term[] $terms Array of term objects appearing in the post row.
*/
$term_links = apply_filters( 'post_column_taxonomy_links', $term_links, $taxonomy, $terms );

View File

@ -706,7 +706,7 @@ final class WP_Privacy_Policy_Content {
* @since 5.0.0 Added the `$strings`, `$description`, and `$blocks` parameters.
*
* @param string $content The default policy content.
* @param array $strings An array of privacy policy content strings.
* @param string[] $strings An array of privacy policy content strings.
* @param bool $description Whether policy descriptions should be included.
* @param bool $blocks Whether the content should be formatted for the block editor.
*/

View File

@ -175,7 +175,7 @@ class WP_Upgrader {
*
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
*
* @param array $directories Optional. A list of directories. If any of these do
* @param string[] $directories Optional. Array of directories. If any of these do
* not exist, a WP_Error object will be returned.
* Default empty array.
* @param bool $allow_relaxed_file_ownership Whether to allow relaxed file ownership.

View File

@ -1731,8 +1731,8 @@ function wp_dashboard_php_nag() {
*
* @since 5.1.0
*
* @param array $classes Metabox classes.
* @return array Modified metabox classes.
* @param string[] $classes Array of metabox classes.
* @return string[] Modified array of metabox classes.
*/
function dashboard_php_nag_class( $classes ) {
$response = wp_check_php_version();

View File

@ -1061,11 +1061,11 @@ function download_url( $url, $timeout = 300, $signature_verification = false ) {
// If the caller expects signature verification to occur, check to see if this URL supports it.
if ( $signature_verification ) {
/**
* Filters the list of hosts which should have Signature Verification attempteds on.
* Filters the list of hosts which should have Signature Verification attempted on.
*
* @since 5.2.0
*
* @param array List of hostnames.
* @param string[] $hostnames List of hostnames.
*/
$signed_hostnames = apply_filters( 'wp_signature_hosts', array( 'wordpress.org', 'downloads.wordpress.org', 's.w.org' ) );
$signature_verification = in_array( parse_url( $url, PHP_URL_HOST ), $signed_hostnames, true );
@ -1341,7 +1341,7 @@ function verify_file_signature( $filename, $signatures, $filename_for_errors = f
*
* @since 5.2.0
*
* @return array List of base64-encoded Signing keys.
* @return string[] Array of base64-encoded signing keys.
*/
function wp_trusted_keys() {
$trusted_keys = array();
@ -1354,11 +1354,11 @@ function wp_trusted_keys() {
// TODO: Add key #2 with longer expiration.
/**
* Filter the valid Signing keys used to verify the contents of files.
* Filter the valid signing keys used to verify the contents of files.
*
* @since 5.2.0
*
* @param array $trusted_keys The trusted keys that may sign packages.
* @param string[] $trusted_keys The trusted keys that may sign packages.
*/
return apply_filters( 'wp_trusted_keys', $trusted_keys );
}
@ -1451,7 +1451,7 @@ function unzip_file( $file, $to ) {
*
* @param string $file Full path and filename of ZIP archive.
* @param string $to Full path on the filesystem to extract archive to.
* @param array $needed_dirs A partial list of required folders needed to be created.
* @param string[] $needed_dirs A partial list of required folders needed to be created.
* @return true|WP_Error True on success, WP_Error on failure.
*/
function _unzip_file_ziparchive( $file, $to, $needed_dirs = array() ) {
@ -1582,7 +1582,7 @@ function _unzip_file_ziparchive( $file, $to, $needed_dirs = array() ) {
*
* @param string $file Full path and filename of ZIP archive.
* @param string $to Full path on the filesystem to extract archive to.
* @param array $needed_dirs A partial list of required folders needed to be created.
* @param string[] $needed_dirs A partial list of required folders needed to be created.
* @return true|WP_Error True on success, WP_Error on failure.
*/
function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) {
@ -1693,7 +1693,7 @@ function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) {
*
* @param string $from Source directory.
* @param string $to Destination directory.
* @param array $skip_list A list of files/folders to skip copying.
* @param string[] $skip_list An array of files/folders to skip copying.
* @return true|WP_Error True on success, WP_Error on failure.
*/
function copy_dir( $from, $to, $skip_list = array() ) {

View File

@ -66,11 +66,13 @@ function _get_list_table( $class, $args = array() ) {
/**
* Register column headers for a particular screen.
*
* @see get_column_headers(), print_column_headers(), get_hidden_columns()
*
* @since 2.7.0
*
* @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions.
* @param array $columns An array of columns with column IDs as the keys and translated column names as the values
* @see get_column_headers(), print_column_headers(), get_hidden_columns()
* @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the
* add_*_page() functions.
* @param string[] $columns An array of columns with column IDs as the keys and translated column names as the values.
*/
function register_column_headers( $screen, $columns ) {
new _WP_List_Table_Compat( $screen, $columns );

View File

@ -11,7 +11,7 @@
*
* @since 2.5.0
*
* @return array default tabs
* @return string[] Default tabs.
*/
function media_upload_tabs() {
$_default_tabs = array(
@ -26,7 +26,7 @@ function media_upload_tabs() {
*
* @since 2.5.0
*
* @param array $_default_tabs An array of media tabs.
* @param string[] $_default_tabs An array of media tabs.
*/
return apply_filters( 'media_upload_tabs', $_default_tabs );
}
@ -1128,8 +1128,8 @@ function image_size_input_fields( $post, $check = '' ) {
*
* @since 3.3.0
*
* @param array $size_names Array of image sizes and their names. Default values
* include 'Thumbnail', 'Medium', 'Large', 'Full Size'.
* @param string[] $size_names Array of image size labels keyed by their name. Default values
* include 'Thumbnail', 'Medium', 'Large', and 'Full Size'.
*/
$size_names = apply_filters(
'image_size_names_choose',

View File

@ -2191,7 +2191,7 @@ function get_block_categories( $post ) {
*
* @since 5.0.0
*
* @param array $default_categories Array of block categories.
* @param array[] $default_categories Array of block categories.
* @param WP_Post $post Post being loaded.
*/
return apply_filters( 'block_categories', $default_categories, $post );

View File

@ -14,7 +14,7 @@
* @staticvar array $column_headers
*
* @param string|WP_Screen $screen The screen you want the headers for
* @return array Containing the headers in the format id => UI String
* @return string[] The column header labels keyed by column ID.
*/
function get_column_headers( $screen ) {
if ( is_string( $screen ) ) {
@ -24,7 +24,6 @@ function get_column_headers( $screen ) {
static $column_headers = array();
if ( ! isset( $column_headers[ $screen->id ] ) ) {
/**
* Filters the column headers for a list table on a specific screen.
*
@ -35,7 +34,7 @@ function get_column_headers( $screen ) {
*
* @since 3.0.0
*
* @param array $columns An array of column headers. Default empty.
* @param string[] $columns The column header labels keyed by column ID.
*/
$column_headers[ $screen->id ] = apply_filters( "manage_{$screen->id}_columns", array() );
}

View File

@ -154,7 +154,7 @@ function wp_get_available_translations() {
*
* @global string $wp_local_package
*
* @param array $languages Array of available languages (populated via the Translation API).
* @param array[] $languages Array of available languages (populated via the Translation API).
*/
function wp_install_language_form( $languages ) {
global $wp_local_package;

View File

@ -1311,10 +1311,10 @@ function update_core( $from, $to ) {
*
* @global WP_Filesystem_Base $wp_filesystem
*
* @param string $from source directory
* @param string $to destination directory
* @param array $skip_list a list of files/folders to skip copying
* @return mixed WP_Error on failure, True on success.
* @param string $from Source directory.
* @param string $to Destination directory.
* @param string[] $skip_list Array of files/folders to skip copying.
* @return WP_Error|true WP_Error on failure, true on success.
*/
function _copy_dir( $from, $to, $skip_list = array() ) {
global $wp_filesystem;

View File

@ -809,7 +809,8 @@ function get_role( $role ) {
*
* @param string $role Role name.
* @param string $display_name Display name for role.
* @param array $capabilities List of capabilities, e.g. array( 'edit_posts' => true, 'delete_posts' => false );
* @param bool[] $capabilities List of capabilities keyed by the capability name,
* e.g. array( 'edit_posts' => true, 'delete_posts' => false ).
* @return WP_Role|null WP_Role object if role is added, null if already exists.
*/
function add_role( $role, $display_name, $capabilities = array() ) {

View File

@ -521,8 +521,8 @@ class WP_Http {
*
* @since 3.7.0
*
* @param array $transports Array of HTTP transports to check. Default array contains
* 'curl', and 'streams', in that order.
* @param string[] $transports Array of HTTP transports to check. Default array contains
* 'curl' and 'streams', in that order.
* @param array $args HTTP request arguments.
* @param string $url The URL to request.
*/

View File

@ -174,8 +174,7 @@ class WP_Http_Encoding {
*
* @since 3.6.0
*
* @param array $type Encoding types allowed. Accepts 'gzinflate',
* 'gzuncompress', 'gzdecode'.
* @param string[] $type Array of what encoding types to accept and their priority values.
* @param string $url URL of the HTTP request.
* @param array $args HTTP request arguments.
*/

View File

@ -854,7 +854,7 @@ class WP_Rewrite {
* over and rewrite rules built for each in-turn. Default true.
* @param bool $endpoints Optional. Whether endpoints should be applied to the generated rewrite rules.
* Default true.
* @return array Rewrite rule list.
* @return string[] Array of rewrite rules keyed by their regex pattern.
*/
public function generate_rewrite_rules( $permalink_structure, $ep_mask = EP_NONE, $paged = true, $feed = true, $forcomments = false, $walk_dirs = true, $endpoints = true ) {
// Build a regex to match the feed section of URLs, something like (feed|atom|rss|rss2)/?
@ -1287,7 +1287,7 @@ class WP_Rewrite {
*
* @since 1.5.0
*
* @param array $post_rewrite The rewrite rules for posts.
* @param string[] $post_rewrite Array of rewrite rules for posts, keyed by their regex pattern.
*/
$post_rewrite = apply_filters( 'post_rewrite_rules', $post_rewrite );
@ -1301,7 +1301,7 @@ class WP_Rewrite {
*
* @since 1.5.0
*
* @param array $date_rewrite The rewrite rules for date archives.
* @param string[] $date_rewrite Array of rewrite rules for date archives, keyed by their regex pattern.
*/
$date_rewrite = apply_filters( 'date_rewrite_rules', $date_rewrite );
@ -1316,7 +1316,7 @@ class WP_Rewrite {
*
* @since 1.5.0
*
* @param array $root_rewrite The root-level rewrite rules.
* @param string[] $root_rewrite Array of root-level rewrite rules, keyed by their regex pattern.
*/
$root_rewrite = apply_filters( 'root_rewrite_rules', $root_rewrite );
@ -1330,7 +1330,7 @@ class WP_Rewrite {
*
* @since 1.5.0
*
* @param array $comments_rewrite The rewrite rules for the site-wide comments feeds.
* @param string[] $comments_rewrite Array of rewrite rules for the site-wide comments feeds, keyed by their regex pattern.
*/
$comments_rewrite = apply_filters( 'comments_rewrite_rules', $comments_rewrite );
@ -1346,7 +1346,7 @@ class WP_Rewrite {
*
* @since 1.5.0
*
* @param array $search_rewrite The rewrite rules for search queries.
* @param string[] $search_rewrite Array of rewrite rules for search queries, keyed by their regex pattern.
*/
$search_rewrite = apply_filters( 'search_rewrite_rules', $search_rewrite );
@ -1361,7 +1361,7 @@ class WP_Rewrite {
*
* @since 1.5.0
*
* @param array $author_rewrite The rewrite rules for author archives.
* @param string[] $author_rewrite Array of rewrite rules for author archives, keyed by their regex pattern.
*/
$author_rewrite = apply_filters( 'author_rewrite_rules', $author_rewrite );
@ -1373,7 +1373,7 @@ class WP_Rewrite {
*
* @since 1.5.0
*
* @param array $page_rewrite The rewrite rules for the "page" post type.
* @param string[] $page_rewrite Array of rewrite rules for the "page" post type, keyed by their regex pattern.
*/
$page_rewrite = apply_filters( 'page_rewrite_rules', $page_rewrite );
@ -1398,7 +1398,7 @@ class WP_Rewrite {
*
* @since 3.1.0
*
* @param array $rules The rewrite rules generated for the current permastruct.
* @param string[] $rules Array of rewrite rules generated for the current permastruct, keyed by their regex pattern.
*/
$rules = apply_filters( "{$permastructname}_rewrite_rules", $rules );
if ( 'post_tag' == $permastructname ) {
@ -1409,7 +1409,7 @@ class WP_Rewrite {
* @since 2.3.0
* @deprecated 3.1.0 Use 'post_tag_rewrite_rules' instead
*
* @param array $rules The rewrite rules generated for tags.
* @param string[] $rules Array of rewrite rules generated for tags, keyed by their regex pattern.
*/
$rules = apply_filters( 'tag_rewrite_rules', $rules );
}
@ -1438,7 +1438,7 @@ class WP_Rewrite {
*
* @since 1.5.0
*
* @param array $this->rules The compiled array of rewrite rules.
* @param string[] $this->rules The compiled array of rewrite rules, keyed by their regex pattern.
*/
$this->rules = apply_filters( 'rewrite_rules_array', $this->rules );

View File

@ -38,7 +38,8 @@ class WP_Role {
* @since 2.0.0
*
* @param string $role Role name.
* @param array $capabilities List of capabilities.
* @param bool[] $capabilities List of capabilities keyed by the capability name,
* e.g. array( 'edit_posts' => true, 'delete_posts' => false ).
*/
public function __construct( $role, $capabilities ) {
$this->name = $role;

View File

@ -149,7 +149,8 @@ class WP_Roles {
*
* @param string $role Role name.
* @param string $display_name Role display name.
* @param array $capabilities List of role capabilities in the above format.
* @param bool[] $capabilities List of capabilities keyed by the capability name,
* e.g. array( 'edit_posts' => true, 'delete_posts' => false ).
* @return WP_Role|void WP_Role object, if role is added.
*/
public function add_role( $role, $display_name, $capabilities = array() ) {

View File

@ -161,7 +161,7 @@ class wp_xmlrpc_server extends IXR_Server {
*
* @since 1.5.0
*
* @param array $methods An array of XML-RPC methods.
* @param string[] $methods An array of XML-RPC methods, keyed by their methodName.
*/
$this->methods = apply_filters( 'xmlrpc_methods', $this->methods );
}

View File

@ -1991,7 +1991,7 @@ function comment_form_title( $noreplytext = false, $replytext = false, $linktopa
* @type bool $short_ping Whether to output short pings. Default false.
* @type bool $echo Whether to echo the output or return it. Default true.
* }
* @param array $comments Optional. Array of WP_Comment objects.
* @param WP_Comment[] $comments Optional. Array of WP_Comment objects.
*/
function wp_list_comments( $args = array(), $comments = null ) {
global $wp_query, $comment_alt, $comment_depth, $comment_thread_alt, $overridden_cpage, $in_comment_loop;

View File

@ -230,7 +230,7 @@ function wptexturize( $text, $reset = false ) {
*
* @since 2.8.0
*
* @param array $default_no_texturize_tags An array of HTML element names.
* @param string[] $default_no_texturize_tags An array of HTML element names.
*/
$no_texturize_tags = apply_filters( 'no_texturize_tags', $default_no_texturize_tags );
/**
@ -238,7 +238,7 @@ function wptexturize( $text, $reset = false ) {
*
* @since 2.8.0
*
* @param array $default_no_texturize_shortcodes An array of shortcode names.
* @param string[] $default_no_texturize_shortcodes An array of shortcode names.
*/
$no_texturize_shortcodes = apply_filters( 'no_texturize_shortcodes', $default_no_texturize_shortcodes );
@ -398,8 +398,8 @@ function wptexturize_primes( $haystack, $needle, $prime, $open_quote, $close_quo
* @access private
*
* @param string $text Text to check. Must be a tag like `<html>` or `[shortcode]`.
* @param array $stack List of open tag elements.
* @param array $disabled_elements The tag names to match against. Spaces are not allowed in tag names.
* @param string[] $stack Array of open tag elements.
* @param string[] $disabled_elements Array of tag names to match against. Spaces are not allowed in tag names.
*/
function _wptexturize_pushpop_element( $text, &$stack, $disabled_elements ) {
// Is it an opening tag or closing tag?
@ -736,10 +736,9 @@ function _get_wptexturize_split_regex( $shortcode_regex = '' ) {
*
* @access private
* @ignore
* @internal This function will be removed in 4.5.0 per Shortcode API Roadmap.
* @since 4.4.0
*
* @param array $tagnames List of shortcodes to find.
* @param string[] $tagnames Array of shortcodes to find.
* @return string The regular expression
*/
function _get_wptexturize_shortcode_regex( $tagnames ) {
@ -2000,8 +1999,8 @@ function remove_accents( $string ) {
*
* @since 2.1.0
*
* @param string $filename The filename to be sanitized
* @return string The sanitized filename
* @param string $filename The filename to be sanitized.
* @return string The sanitized filename.
*/
function sanitize_file_name( $filename ) {
$filename_raw = $filename;
@ -2011,8 +2010,8 @@ function sanitize_file_name( $filename ) {
*
* @since 2.8.0
*
* @param array $special_chars Characters to remove.
* @param string $filename_raw Filename as it was passed into sanitize_file_name().
* @param string[] $special_chars Array of characters to remove.
* @param string $filename_raw The original filename to be sanitized.
*/
$special_chars = apply_filters( 'sanitize_file_name_chars', $special_chars, $filename_raw );
$filename = preg_replace( "#\x{00a0}#siu", ' ', $filename );
@ -4269,7 +4268,7 @@ function esc_sql( $data ) {
* @since 2.8.0
*
* @param string $url The URL to be cleaned.
* @param array $protocols Optional. An array of acceptable protocols.
* @param string[] $protocols Optional. An array of acceptable protocols.
* Defaults to return value of wp_allowed_protocols()
* @param string $_context Private. Use esc_url_raw() for database usage.
* @return string The cleaned $url after the {@see 'clean_url'} filter is applied.
@ -4377,7 +4376,7 @@ function esc_url( $url, $protocols = null, $_context = 'display' ) {
* @since 2.8.0
*
* @param string $url The URL to be cleaned.
* @param array $protocols An array of acceptable protocols.
* @param string[] $protocols An array of acceptable protocols.
* @return string The cleaned URL.
*/
function esc_url_raw( $url, $protocols = null ) {
@ -5122,7 +5121,7 @@ function _links_add_base( $m ) {
*
* @param string $content String to search for links in.
* @param string $target The Target to add to the links.
* @param array $tags An array of tags to apply to.
* @param string[] $tags An array of tags to apply to.
* @return string The processed content.
*/
function links_add_target( $content, $target = '_blank', $tags = array( 'a' ) ) {

View File

@ -862,7 +862,7 @@ function do_enclose( $content = null, $post ) {
*
* @since 4.4.0
*
* @param array $post_links An array of enclosure links.
* @param string[] $post_links An array of enclosure links.
* @param int $post_ID Post ID.
*/
$post_links = apply_filters( 'enclosure_links', $post_links, $post->ID );
@ -1147,7 +1147,7 @@ function remove_query_arg( $key, $query = false ) {
*
* @since 4.4.0
*
* @return array An array of parameters to remove from the URL.
* @return string[] An array of parameters to remove from the URL.
*/
function wp_removable_query_args() {
$removable_query_args = array(
@ -1181,7 +1181,7 @@ function wp_removable_query_args() {
*
* @since 4.2.0
*
* @param array $removable_query_args An array of query variables to remove from a URL.
* @param string[] $removable_query_args An array of query variables to remove from a URL.
*/
return apply_filters( 'removable_query_args', $removable_query_args );
}
@ -2614,8 +2614,13 @@ function wp_ext2type( $ext ) {
* @since 2.0.4
*
* @param string $filename File name or path.
* @param array $mimes Optional. Key is the file extension with value as the mime type.
* @return array Values with extension first and mime type.
* @param string[] $mimes Optional. Array of mime types keyed by their file extension regex.
* @return array {
* Values with extension first and mime type.
*
* @type string $0 File extension.
* @type string $1 File mime type.
* }
*/
function wp_check_filetype( $filename, $mimes = null ) {
if ( empty( $mimes ) ) {
@ -2651,7 +2656,7 @@ function wp_check_filetype( $filename, $mimes = null ) {
* @param string $file Full path to the file.
* @param string $filename The name of the file (may differ from $file due to $file being
* in a tmp directory).
* @param array $mimes Optional. Key is the file extension with value as the mime type.
* @param string[] $mimes Optional. Array of mime types keyed by their file extension regex.
* @return array Values for the extension, MIME, and either a corrected filename or false
* if original $filename is valid.
*/
@ -2814,7 +2819,7 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
* @param string $file Full path to the file.
* @param string $filename The name of the file (may differ from $file due to
* $file being in a tmp directory).
* @param array $mimes Key is the file extension with value as the mime type.
* @param string[] $mimes Array of mime types keyed by their file extension regex.
* @param string|bool $real_mime The actual mime type or false if the type cannot be determined.
*/
return apply_filters( 'wp_check_filetype_and_ext', compact( 'ext', 'type', 'proper_filename' ), $file, $filename, $mimes, $real_mime );
@ -2861,7 +2866,7 @@ function wp_get_image_mime( $file ) {
* @since 4.9.2 Support was added for Flac (.flac) files.
* @since 4.9.6 Support was added for AAC (.aac) files.
*
* @return array Array of mime types keyed by the file extension regex corresponding to those types.
* @return string[] Array of mime types keyed by the file extension regex corresponding to those types.
*/
function wp_get_mime_types() {
/**
@ -2872,7 +2877,7 @@ function wp_get_mime_types() {
*
* @since 3.5.0
*
* @param array $wp_get_mime_types Mime types keyed by the file extension regex
* @param string[] $wp_get_mime_types Mime types keyed by the file extension regex
* corresponding to those types.
*/
return apply_filters(
@ -3024,7 +3029,7 @@ function wp_get_ext_types() {
* @since 2.8.6
*
* @param int|WP_User $user Optional. User to check. Defaults to current user.
* @return array Array of mime types keyed by the file extension regex corresponding
* @return string[] Array of mime types keyed by the file extension regex corresponding
* to those types.
*/
function get_allowed_mime_types( $user = null ) {
@ -4154,7 +4159,7 @@ function smilies_init() {
*
* @since 4.7.0
*
* @param array $wpsmiliestrans List of the smilies.
* @param string[] $wpsmiliestrans List of the smilies' hexadecimal representations, keyed by their smily code.
*/
$wpsmiliestrans = apply_filters( 'smilies', $wpsmiliestrans );
@ -5011,7 +5016,7 @@ function iis7_supports_permalinks() {
* @since 1.2.0
*
* @param string $file File path.
* @param array $allowed_files Optional. List of allowed files.
* @param string[] $allowed_files Optional. Array of allowed files.
* @return int 0 means nothing is wrong, greater than 0 means something was wrong.
*/
function validate_file( $file, $allowed_files = array() ) {
@ -5978,7 +5983,7 @@ function wp_allowed_protocols() {
*
* @since 3.0.0
*
* @param array $protocols Array of allowed protocols e.g. 'http', 'ftp', 'tel', and more.
* @param string[] $protocols Array of allowed protocols e.g. 'http', 'ftp', 'tel', and more.
*/
$protocols = array_unique( (array) apply_filters( 'kses_allowed_protocols', $protocols ) );
}

View File

@ -1280,7 +1280,7 @@ function wp_title( $sep = '&raquo;', $display = true, $seplocation = '' ) {
*
* @since 4.0.0
*
* @param array $title_array Parts of the page title.
* @param string[] $title_array Array of parts of the page title.
*/
$title_array = apply_filters( 'wp_title_parts', explode( $t_sep, $title ) );

View File

@ -704,8 +704,8 @@ function wp_get_active_and_valid_plugins() {
*
* @since 5.2.0
*
* @param array $plugins List of absolute plugin main file paths.
* @return array Filtered value of $plugins, without any paused plugins.
* @param string[] $plugins Array of absolute plugin main file paths.
* @return string[] Filtered array of plugins, without any paused plugins.
*/
function wp_skip_paused_plugins( array $plugins ) {
$paused_plugins = wp_paused_plugins()->get_all();
@ -774,8 +774,8 @@ function wp_get_active_and_valid_themes() {
*
* @since 5.2.0
*
* @param array $themes List of absolute theme directory paths.
* @return array Filtered value of $themes, without any paused themes.
* @param string[] $themes Array of absolute theme directory paths.
* @return string[] Filtered array of themes, without any paused themes.
*/
function wp_skip_paused_themes( array $themes ) {
$paused_themes = wp_paused_themes()->get_all();
@ -882,7 +882,7 @@ function is_protected_ajax_action() {
*
* @since 5.2.0
*
* @param array $actions_to_protect Array of strings with AJAX actions to protect.
* @param string[] $actions_to_protect Array of strings with AJAX actions to protect.
*/
$actions_to_protect = (array) apply_filters( 'wp_protected_ajax_actions', $actions_to_protect );

View File

@ -1039,7 +1039,7 @@ function wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = f
*
* @since 2.8.0
*
* @param array $attr Attributes for the image markup.
* @param string[] $attr Array of attribute values for the image markup, keyed by attribute name.
* @param WP_Post $attachment Image attachment post.
* @param string|array $size Requested size. Image size or array of width and height values
* (in that order). Default 'thumbnail'.
@ -1603,8 +1603,8 @@ function wp_image_add_srcset_and_sizes( $image, $image_meta, $attachment_id ) {
* @ignore
* @since 2.9.0
*
* @param array $attr Thumbnail attributes including src, class, alt, title.
* @return array Modified array of attributes including the new 'wp-post-image' class.
* @param string[] $attr Array of thumbnail attributes including src, class, alt, title, keyed by attribute name.
* @return string[] Modified array of attributes including the new 'wp-post-image' class.
*/
function _wp_post_thumbnail_class_filter( $attr ) {
$attr['class'] .= ' wp-post-image';
@ -1618,7 +1618,7 @@ function _wp_post_thumbnail_class_filter( $attr ) {
* @ignore
* @since 2.9.0
*
* @param array $attr Thumbnail attributes including src, class, alt, title.
* @param string[] $attr Array of thumbnail attributes including src, class, alt, title, keyed by attribute name.
*/
function _wp_post_thumbnail_class_filter_add( $attr ) {
add_filter( 'wp_get_attachment_image_attributes', '_wp_post_thumbnail_class_filter' );
@ -1631,7 +1631,7 @@ function _wp_post_thumbnail_class_filter_add( $attr ) {
* @ignore
* @since 2.9.0
*
* @param array $attr Thumbnail attributes including src, class, alt, title.
* @param string[] $attr Array of thumbnail attributes including src, class, alt, title, keyed by attribute name.
*/
function _wp_post_thumbnail_class_filter_remove( $attr ) {
remove_filter( 'wp_get_attachment_image_attributes', '_wp_post_thumbnail_class_filter' );
@ -2416,7 +2416,7 @@ function wp_mediaelement_fallback( $url ) {
*
* @since 3.6.0
*
* @return array Supported audio formats.
* @return string[] Supported audio formats.
*/
function wp_get_audio_extensions() {
/**
@ -2424,7 +2424,7 @@ function wp_get_audio_extensions() {
*
* @since 3.6.0
*
* @param array $extensions An array of supported audio formats. Defaults are
* @param string[] $extensions An array of supported audio formats. Defaults are
* 'mp3', 'ogg', 'flac', 'm4a', 'wav'.
*/
return apply_filters( 'wp_audio_extensions', array( 'mp3', 'ogg', 'flac', 'm4a', 'wav' ) );
@ -2664,7 +2664,7 @@ add_shortcode( 'audio', 'wp_audio_shortcode' );
*
* @since 3.6.0
*
* @return array List of supported video formats.
* @return string[] List of supported video formats.
*/
function wp_get_video_extensions() {
/**
@ -2672,7 +2672,7 @@ function wp_get_video_extensions() {
*
* @since 3.6.0
*
* @param array $extensions An array of supported video formats. Defaults are
* @param string[] $extensions An array of supported video formats. Defaults are
* 'mp4', 'm4v', 'webm', 'ogv', 'flv'.
*/
return apply_filters( 'wp_video_extensions', array( 'mp4', 'm4v', 'webm', 'ogv', 'flv' ) );
@ -3266,7 +3266,7 @@ function _wp_image_editor_choose( $args = array() ) {
*
* @since 3.5.0
*
* @param array $image_editors List of available image editors. Defaults are
* @param string[] $image_editors Array of available image editor class names. Defaults are
* 'WP_Image_Editor_Imagick', 'WP_Image_Editor_GD'.
*/
$implementations = apply_filters( 'wp_image_editors', array( 'WP_Image_Editor_Imagick', 'WP_Image_Editor_GD' ) );
@ -3983,7 +3983,7 @@ function wp_enqueue_media( $args = array() ) {
*
* @since 3.5.0
*
* @param array $strings List of media view strings.
* @param string[] $strings Array of media view strings keyed by the name they'll be referenced by in JavaScript.
* @param WP_Post $post Post object.
*/
$strings = apply_filters( 'media_view_strings', $strings, $post );
@ -4024,7 +4024,7 @@ function wp_enqueue_media( $args = array() ) {
*
* @param string $type Mime type.
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
* @return array Found attachments.
* @return WP_Post[] Array of media attached to the given post.
*/
function get_attached_media( $type, $post = 0 ) {
$post = get_post( $post );
@ -4060,7 +4060,7 @@ function get_attached_media( $type, $post = 0 ) {
*
* @since 3.6.0
*
* @param array $children Associative array of media attached to the given post.
* @param WP_Post[] $children Array of media attached to the given post.
* @param string $type Mime type of the media desired.
* @param WP_Post $post Post object.
*/
@ -4072,9 +4072,9 @@ function get_attached_media( $type, $post = 0 ) {
*
* @since 3.6.0
*
* @param string $content A string which might contain media data.
* @param array $types An array of media types: 'audio', 'video', 'object', 'embed', or 'iframe'.
* @return array A list of found HTML media embeds.
* @param string $content A string of HTML which might contain media elements.
* @param string[] $types An array of media types: 'audio', 'video', 'object', 'embed', or 'iframe'.
* @return string[] Array of found HTML media elements.
*/
function get_media_embedded_in_content( $content, $types = null ) {
$html = array();
@ -4084,7 +4084,7 @@ function get_media_embedded_in_content( $content, $types = null ) {
*
* @since 4.2.0
*
* @param array $allowed_media_types An array of allowed media types. Default media types are
* @param string[] $allowed_media_types An array of allowed media types. Default media types are
* 'audio', 'video', 'object', 'embed', and 'iframe'.
*/
$allowed_media_types = apply_filters( 'media_embedded_in_content_allowed_types', array( 'audio', 'video', 'object', 'embed', 'iframe' ) );
@ -4326,8 +4326,8 @@ function wpview_media_sandbox_styles() {
/**
* Registers the personal data exporter for media.
*
* @param array $exporters An array of personal data exporters.
* @return array An array of personal data exporters.
* @param array[] $exporters An array of personal data exporters, keyed by their ID.
* @return array[] Updated array of personal data exporters.
*/
function wp_register_media_personal_data_exporter( $exporters ) {
$exporters['wordpress-media'] = array(

View File

@ -406,7 +406,7 @@ function delete_metadata( $meta_type, $object_id, $meta_key, $meta_value = '', $
*
* @since 3.1.0
*
* @param array $meta_ids An array of metadata entry IDs to delete.
* @param string[] $meta_ids An array of metadata entry IDs to delete.
* @param int $object_id Object ID.
* @param string $meta_key Meta key.
* @param mixed $_meta_value Meta value.
@ -420,7 +420,7 @@ function delete_metadata( $meta_type, $object_id, $meta_key, $meta_value = '', $
*
* @since 2.9.0
*
* @param array $meta_ids An array of post metadata entry IDs to delete.
* @param string[] $meta_ids An array of metadata entry IDs to delete.
*/
do_action( 'delete_postmeta', $meta_ids );
}
@ -449,7 +449,7 @@ function delete_metadata( $meta_type, $object_id, $meta_key, $meta_value = '', $
*
* @since 2.9.0
*
* @param array $meta_ids An array of deleted metadata entry IDs.
* @param string[] $meta_ids An array of metadata entry IDs to delete.
* @param int $object_id Object ID.
* @param string $meta_key Meta key.
* @param mixed $_meta_value Meta value.
@ -463,7 +463,7 @@ function delete_metadata( $meta_type, $object_id, $meta_key, $meta_value = '', $
*
* @since 2.9.0
*
* @param array $meta_ids An array of deleted post metadata entry IDs.
* @param string[] $meta_ids An array of metadata entry IDs to delete.
*/
do_action( 'deleted_postmeta', $meta_ids );
}

View File

@ -2600,7 +2600,7 @@ function get_subdirectory_reserved_names() {
* @since 4.4.0 'wp-admin', 'wp-content', 'wp-includes', 'wp-json', and 'embed' were added
* to the reserved names list.
*
* @param array $subdirectory_reserved_names Array of reserved names.
* @param string[] $subdirectory_reserved_names Array of reserved names.
*/
return apply_filters( 'subdirectory_reserved_names', $names );
}

View File

@ -208,7 +208,7 @@ function get_site_by_path( $domain, $path, $segments = null ) {
* @param string $path The requested path, in full.
* @param int|null $segments The suggested number of paths to consult.
* Default null, meaning the entire path was to be consulted.
* @param array $paths The paths to search for, based on $path and $segments.
* @param string[] $paths The paths to search for, based on $path and $segments.
*/
$pre = apply_filters( 'pre_get_site_by_path', null, $domain, $path, $segments, $paths );
if ( null !== $pre ) {

View File

@ -169,7 +169,7 @@ function wp_nav_menu( $args = array() ) {
*
* @since 3.0.0
*
* @param array $tags The acceptable HTML tags for use as menu containers.
* @param string[] $tags The acceptable HTML tags for use as menu containers.
* Default is array containing 'div' and 'nav'.
*/
$allowed_tags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'nav' ) );

View File

@ -617,7 +617,7 @@ function wp_get_nav_menus( $args = array() ) {
*
* @see get_terms()
*
* @param array $menus An array of menu objects.
* @param WP_Term[] $menus An array of menu objects.
* @param array $args An array of arguments used to retrieve menu objects.
*/
return apply_filters( 'wp_get_nav_menus', get_terms( $args ), $args );

View File

@ -635,7 +635,7 @@ if ( ! function_exists( 'wp_validate_auth_cookie' ) ) :
*
* @since 2.7.0
*
* @param array $cookie_elements An array of data for the authentication cookie.
* @param string[] $cookie_elements An array of data for the authentication cookie.
*/
do_action( 'auth_cookie_expired', $cookie_elements );
return false;
@ -648,7 +648,7 @@ if ( ! function_exists( 'wp_validate_auth_cookie' ) ) :
*
* @since 2.7.0
*
* @param array $cookie_elements An array of data for the authentication cookie.
* @param string[] $cookie_elements An array of data for the authentication cookie.
*/
do_action( 'auth_cookie_bad_username', $cookie_elements );
return false;
@ -668,7 +668,7 @@ if ( ! function_exists( 'wp_validate_auth_cookie' ) ) :
*
* @since 2.7.0
*
* @param array $cookie_elements An array of data for the authentication cookie.
* @param string[] $cookie_elements An array of data for the authentication cookie.
*/
do_action( 'auth_cookie_bad_hash', $cookie_elements );
return false;
@ -690,7 +690,7 @@ if ( ! function_exists( 'wp_validate_auth_cookie' ) ) :
*
* @since 2.7.0
*
* @param array $cookie_elements An array of data for the authentication cookie.
* @param string[] $cookie_elements An array of data for the authentication cookie.
* @param WP_User $user User object.
*/
do_action( 'auth_cookie_valid', $cookie_elements, $user );
@ -758,7 +758,7 @@ if ( ! function_exists( 'wp_parse_auth_cookie' ) ) :
*
* @param string $cookie Authentication cookie.
* @param string $scheme Optional. The cookie scheme to use: 'auth', 'secure_auth', or 'logged_in'.
* @return array|false Authentication cookie components.
* @return string[]|false Authentication cookie components.
*/
function wp_parse_auth_cookie( $cookie = '', $scheme = '' ) {
if ( empty( $cookie ) ) {
@ -1442,8 +1442,8 @@ if ( ! function_exists( 'wp_validate_redirect' ) ) :
*
* @since 2.3.0
*
* @param array $hosts An array of allowed hosts.
* @param bool|string $host The parsed host; empty if not isset.
* @param string[] $hosts An array of allowed host names.
* @param string $host The host name of the redirect destination; empty string if not set.
*/
$allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array( $wpp['host'] ), isset( $lp['host'] ) ? $lp['host'] : '' );
@ -1492,7 +1492,7 @@ if ( ! function_exists( 'wp_notify_postauthor' ) ) :
*
* @since 3.7.0
*
* @param array $emails An array of email addresses to receive a comment notification.
* @param string[] $emails An array of email addresses to receive a comment notification.
* @param int $comment_id The comment ID.
*/
$emails = apply_filters( 'comment_notification_recipients', $emails, $comment->comment_ID );
@ -1804,7 +1804,7 @@ if ( ! function_exists( 'wp_notify_moderator' ) ) :
*
* @since 3.7.0
*
* @param array $emails List of email addresses to notify for comment moderation.
* @param string[] $emails List of email addresses to notify for comment moderation.
* @param int $comment_id Comment ID.
*/
$emails = apply_filters( 'comment_moderation_recipients', $emails, $comment_id );

View File

@ -1204,7 +1204,7 @@ function wp_dropdown_pages( $args = '' ) {
*
* @param string $output HTML output for drop down list of pages.
* @param array $parsed_args The parsed arguments array.
* @param array $pages List of WP_Post objects returned by `get_pages()`
* @param WP_Post[] $pages Array of the page objects.
*/
$html = apply_filters( 'wp_dropdown_pages', $output, $parsed_args, $pages );
@ -1292,7 +1292,7 @@ function wp_list_pages( $args = '' ) {
*
* @since 2.1.0
*
* @param array $exclude_array An array of page IDs to exclude.
* @param string[] $exclude_array An array of page IDs to exclude.
*/
$parsed_args['exclude'] = implode( ',', apply_filters( 'wp_list_pages_excludes', $exclude_array ) );
@ -1332,7 +1332,7 @@ function wp_list_pages( $args = '' ) {
*
* @param string $output HTML output of the pages list.
* @param array $parsed_args An array of page-listing arguments.
* @param array $pages List of WP_Post objects returned by `get_pages()`
* @param WP_Post[] $pages Array of the page objects.
*/
$html = apply_filters( 'wp_list_pages', $output, $parsed_args, $pages );

View File

@ -632,8 +632,7 @@ function _wp_relative_upload_path( $path ) {
* @param mixed $args Optional. User defined arguments for replacing the defaults. Default empty.
* @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, respectively. Default OBJECT.
* @return array Array of children, where the type of each element is determined by $output parameter.
* Empty array on failure.
* @return WP_Post[]|int[] Array of post objects or post IDs.
*/
function get_children( $args = '', $output = OBJECT ) {
$kids = array();
@ -1599,7 +1598,7 @@ function get_post_type_capabilities( $args ) {
*
* @global array $post_type_meta_caps Used to store meta capabilities.
*
* @param array $capabilities Post type meta capabilities.
* @param string[] $capabilities Post type meta capabilities.
*/
function _post_type_meta_capabilities( $capabilities = null ) {
global $post_type_meta_caps;
@ -4731,7 +4730,7 @@ function get_enclosed( $post_id ) {
*
* @since 2.0.0
*
* @param array $pung Array of enclosures for the given post.
* @param string[] $pung Array of enclosures for the given post.
* @param int $post_id Post ID.
*/
return apply_filters( 'get_enclosed', $pung, $post_id );
@ -4773,7 +4772,7 @@ function get_pung( $post_id ) {
* @since 4.7.0 `$post_id` can be a WP_Post object.
*
* @param int|WP_Post $post_id Post Object or ID
* @return array
* @param string[] List of URLs yet to ping.
*/
function get_to_ping( $post_id ) {
$post = get_post( $post_id );
@ -4790,7 +4789,7 @@ function get_to_ping( $post_id ) {
*
* @since 2.0.0
*
* @param array $to_ping List of URLs yet to ping.
* @param string[] $to_ping List of URLs yet to ping.
*/
return apply_filters( 'get_to_ping', $to_ping );
}
@ -5065,9 +5064,9 @@ function get_page_children( $page_id, $pages ) {
*
* @since 2.0.0
*
* @param array $pages Posts array (passed by reference).
* @param WP_Post[] $pages Posts array (passed by reference).
* @param int $page_id Optional. Parent page ID. Default 0.
* @return array A list arranged by hierarchy. Children immediately follow their parents.
* @return string[] Array of post names keyed by ID and arranged by hierarchy. Children immediately follow their parents.
*/
function get_page_hierarchy( &$pages, $page_id = 0 ) {
if ( empty( $pages ) ) {
@ -5098,7 +5097,7 @@ function get_page_hierarchy( &$pages, $page_id = 0 ) {
*
* @param int $page_id Page ID.
* @param array $children Parent-children relations (passed by reference).
* @param array $result Result (passed by reference).
* @param string[] $result Array of page names keyed by ID (passed by reference).
*/
function _page_traverse_name( $page_id, &$children, &$result ) {
if ( isset( $children[ $page_id ] ) ) {
@ -5461,7 +5460,7 @@ function get_pages( $args = array() ) {
*
* @since 2.1.0
*
* @param array $pages List of pages to retrieve.
* @param WP_Post[] $pages Array of page objects.
* @param array $parsed_args Array of get_pages() arguments.
*/
return apply_filters( 'get_pages', $pages, $parsed_args );
@ -6107,11 +6106,11 @@ function wp_mime_type_icon( $mime = 0 ) {
$icon_dir_uri = apply_filters( 'icon_dir_uri', includes_url( 'images/media' ) );
/**
* Filters the list of icon directory URIs.
* Filters the array of icon directory URIs.
*
* @since 2.5.0
*
* @param array $uris List of icon directory URIs.
* @param string[] $uris Array of icon directory URIs keyed by directory absolute path.
*/
$dirs = apply_filters( 'icon_dirs', array( $icon_dir => $icon_dir_uri ) );
$icon_files = array();
@ -7095,9 +7094,9 @@ function wp_add_trashed_suffix_to_post_name_for_post( $post ) {
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param array $clauses An array including WHERE, GROUP BY, JOIN, ORDER BY,
* @param string[] $clauses An array including WHERE, GROUP BY, JOIN, ORDER BY,
* DISTINCT, fields (SELECT), and LIMITS clauses.
* @return array The modified clauses.
* @return string[] The modified array of clauses.
*/
function _filter_query_attachment_filenames( $clauses ) {
global $wpdb;

View File

@ -1132,7 +1132,7 @@ function get_term_to_edit( $id, $taxonomy ) {
* @param array|string $deprecated Argument array, when using the legacy function parameter format. If present, this
* parameter will be interpreted as `$args`, and the first function parameter will
* be parsed as a taxonomy or array of taxonomies.
* @return array|int|WP_Error List of WP_Term instances and their children. Will return WP_Error, if any of taxonomies
* @return WP_Term[]|int|WP_Error List of WP_Term instances and their children. Will return WP_Error, if any of taxonomies
* do not exist.
*/
function get_terms( $args = array(), $deprecated = '' ) {
@ -3219,9 +3219,9 @@ function clean_object_term_cache( $object_ids, $object_type ) {
* @global wpdb $wpdb WordPress database abstraction object.
* @global bool $_wp_suspend_cache_invalidation
*
* @param int|array $ids Single or list of Term IDs.
* @param string $taxonomy Optional. Can be empty and will assume `tt_ids`, else will use for context.
* Default empty.
* @param int|int[] $ids Single or array of term IDs.
* @param string $taxonomy Optional. Taxonomy slug. Can be empty, in which case the taxonomies of the passed
* term IDs will be used. Default empty.
* @param bool $clean_taxonomy Optional. Whether to clean taxonomy wide caches (true), or just individual
* term object caches (false). Default true.
*/
@ -3436,8 +3436,8 @@ function update_object_term_cache( $object_ids, $object_type ) {
*
* @since 2.3.0
*
* @param array $terms List of term objects to change.
* @param string $taxonomy Optional. Update Term to this taxonomy in cache. Default empty.
* @param WP_Term[] $terms Array of term objects to change.
* @param string $taxonomy Not used.
*/
function update_term_cache( $terms, $taxonomy = '' ) {
foreach ( (array) $terms as $term ) {

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.4-alpha-46595';
$wp_version = '5.4-alpha-46596';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.