Docs: Further improve documentation of known return types, plus other docs fixes.
See #48303 Built from https://develop.svn.wordpress.org/trunk@46661 git-svn-id: http://core.svn.wordpress.org/trunk@46461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f545bb3f63
commit
9ac1d82f23
|
@ -129,7 +129,7 @@ function get_bookmark_field( $field, $bookmark, $context = 'display' ) {
|
|||
* and searched in 'link_url', 'link_name' and 'link_description'.
|
||||
* Default empty.
|
||||
* }
|
||||
* @return array List of bookmark row objects.
|
||||
* @return object[] List of bookmark row objects.
|
||||
*/
|
||||
function get_bookmarks( $args = '' ) {
|
||||
global $wpdb;
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
* @param string $cap Capability name.
|
||||
* @param int $user_id User ID.
|
||||
* @param mixed ...$args Optional further parameters, typically starting with an object ID.
|
||||
* @return array Actual capabilities for meta capability.
|
||||
* @return string[] Actual capabilities for meta capability.
|
||||
*/
|
||||
function map_meta_cap( $cap, $user_id, ...$args ) {
|
||||
$caps = array();
|
||||
|
@ -838,7 +838,7 @@ function remove_role( $role ) {
|
|||
*
|
||||
* @global array $super_admins
|
||||
*
|
||||
* @return array List of super admin logins
|
||||
* @return string[] List of super admin logins.
|
||||
*/
|
||||
function get_super_admins() {
|
||||
global $super_admins;
|
||||
|
|
|
@ -789,7 +789,7 @@ class Requests {
|
|||
* Convert a key => value array to a 'key: value' array for headers
|
||||
*
|
||||
* @param array $array Dictionary of header values
|
||||
* @return array List of headers
|
||||
* @return string[] List of headers
|
||||
*/
|
||||
public static function flatten($array) {
|
||||
$return = array();
|
||||
|
@ -805,7 +805,7 @@ class Requests {
|
|||
* @codeCoverageIgnore
|
||||
* @deprecated Misspelling of {@see Requests::flatten}
|
||||
* @param array $array Dictionary of header values
|
||||
* @return array List of headers
|
||||
* @return string[] List of headers
|
||||
*/
|
||||
public static function flattern($array) {
|
||||
return self::flatten($array);
|
||||
|
|
|
@ -251,7 +251,7 @@ final class WP_Comment {
|
|||
* `$meta_query`. Also accepts false, an empty array, or
|
||||
* 'none' to disable `ORDER BY` clause.
|
||||
* }
|
||||
* @return array Array of `WP_Comment` objects.
|
||||
* @return WP_Comment[] Array of `WP_Comment` objects.
|
||||
*/
|
||||
public function get_children( $args = array() ) {
|
||||
$defaults = array(
|
||||
|
|
|
@ -436,8 +436,8 @@ final class WP_Customize_Manager {
|
|||
*
|
||||
* @since 3.4.0
|
||||
*
|
||||
* @param mixed $ajax_message Ajax return
|
||||
* @param mixed $message UI message
|
||||
* @param string|WP_Error $ajax_message Ajax return.
|
||||
* @param string $message Optional. UI message.
|
||||
*/
|
||||
protected function wp_die( $ajax_message, $message = null ) {
|
||||
if ( $this->doing_ajax() ) {
|
||||
|
|
|
@ -173,14 +173,14 @@ class WP_Embed {
|
|||
$return = call_user_func( $handler['callback'], $matches, $attr, $url, $rawattr );
|
||||
if ( false !== $return ) {
|
||||
/**
|
||||
* Filters the returned embed handler.
|
||||
* Filters the returned embed HTML.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @see WP_Embed::shortcode()
|
||||
*
|
||||
* @param mixed $return The shortcode callback function to call.
|
||||
* @param string $url The attempted embed URL.
|
||||
* @param string|false $return The HTML result of the shortcode, or false on failure.
|
||||
* @param string $url The embed URL.
|
||||
* @param array $attr An array of shortcode attributes.
|
||||
*/
|
||||
return apply_filters( 'embed_handler_html', $return, $url, $attr );
|
||||
|
@ -248,7 +248,7 @@ class WP_Embed {
|
|||
*
|
||||
* @see WP_Embed::shortcode()
|
||||
*
|
||||
* @param mixed $cache The cached HTML result, stored in post meta.
|
||||
* @param string|false $cache The cached HTML result, stored in post meta.
|
||||
* @param string $url The attempted embed URL.
|
||||
* @param array $attr An array of shortcode attributes.
|
||||
* @param int $post_ID Post ID.
|
||||
|
|
|
@ -172,7 +172,12 @@ abstract class WP_Image_Editor {
|
|||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @return array {'width'=>int, 'height'=>int}
|
||||
* @return array {
|
||||
* Dimensions of the image.
|
||||
*
|
||||
* @type int $width The image width.
|
||||
* @type int $height The image height.
|
||||
* }
|
||||
*/
|
||||
public function get_size() {
|
||||
return $this->size;
|
||||
|
|
|
@ -1402,7 +1402,7 @@ class WP_Query {
|
|||
* @since 3.7.0
|
||||
*
|
||||
* @param string[] $terms Array of terms to check.
|
||||
* @return array Terms that are not stopwords.
|
||||
* @return string[] Terms that are not stopwords.
|
||||
*/
|
||||
protected function parse_search_terms( $terms ) {
|
||||
$strtolower = function_exists( 'mb_strtolower' ) ? 'mb_strtolower' : 'strtolower';
|
||||
|
@ -1438,7 +1438,7 @@ class WP_Query {
|
|||
*
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @return array Stopwords.
|
||||
* @return string[] Stopwords.
|
||||
*/
|
||||
protected function get_search_stopwords() {
|
||||
if ( isset( $this->stopwords ) ) {
|
||||
|
@ -3585,7 +3585,7 @@ class WP_Query {
|
|||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param mixed $post_types Optional. Post type or array of posts types to check against.
|
||||
* @param string|string[] $post_types Optional. Post type or array of posts types to check against.
|
||||
* @return bool
|
||||
*/
|
||||
public function is_post_type_archive( $post_types = '' ) {
|
||||
|
|
|
@ -306,7 +306,7 @@ When seeking help with this issue, you may be asked for some of the following in
|
|||
* @since 5.3.0
|
||||
*
|
||||
* @param array $extension The extension that caused the error.
|
||||
* @return array An associated array of debug information.
|
||||
* @return array An associative array of debug information.
|
||||
*/
|
||||
private function get_debug( $extension ) {
|
||||
$theme = wp_get_theme();
|
||||
|
|
|
@ -463,7 +463,7 @@ class WP_Rewrite {
|
|||
*
|
||||
* @since 1.5.0
|
||||
*
|
||||
* @return array Page rewrite rules.
|
||||
* @return string[] Page rewrite rules.
|
||||
*/
|
||||
public function page_rewrite_rules() {
|
||||
// The extra .? at the beginning prevents clashes with other regular expressions in the rules array.
|
||||
|
@ -1250,7 +1250,7 @@ class WP_Rewrite {
|
|||
*
|
||||
* @since 1.5.0
|
||||
*
|
||||
* @return array An associate array of matches and queries.
|
||||
* @return string[] An associative array of matches and queries.
|
||||
*/
|
||||
public function rewrite_rules() {
|
||||
$rewrite = array();
|
||||
|
@ -1455,7 +1455,7 @@ class WP_Rewrite {
|
|||
*
|
||||
* @since 1.5.0
|
||||
*
|
||||
* @return array Rewrite rules.
|
||||
* @return string[] Array of rewrite rules keyed by their regex pattern.
|
||||
*/
|
||||
public function wp_rewrite_rules() {
|
||||
$this->rules = get_option( 'rewrite_rules' );
|
||||
|
|
|
@ -1156,7 +1156,7 @@ final class WP_Theme implements ArrayAccess {
|
|||
* @param mixed $type Optional. Array of extensions to return. Defaults to all files (null).
|
||||
* @param int $depth Optional. How deep to search for files. Defaults to a flat scan (0 depth). -1 depth is infinite.
|
||||
* @param bool $search_parent Optional. Whether to return parent files. Defaults to false.
|
||||
* @return array Array of files, keyed by the path to the file relative to the theme's directory, with the values
|
||||
* @return string[] Array of files, keyed by the path to the file relative to the theme's directory, with the values
|
||||
* being absolute paths.
|
||||
*/
|
||||
public function get_files( $type = null, $depth = 0, $search_parent = false ) {
|
||||
|
@ -1174,7 +1174,7 @@ final class WP_Theme implements ArrayAccess {
|
|||
*
|
||||
* @since 4.7.0
|
||||
*
|
||||
* @return array Array of page templates, keyed by filename and post type,
|
||||
* @return string Array of page templates, keyed by filename and post type,
|
||||
* with the value of the translated header name.
|
||||
*/
|
||||
public function get_post_templates() {
|
||||
|
@ -1233,7 +1233,7 @@ final class WP_Theme implements ArrayAccess {
|
|||
* @param WP_Post|null $post Optional. The post being edited, provided for context.
|
||||
* @param string $post_type Optional. Post type to get the templates for. Default 'page'.
|
||||
* If a post is provided, its post type is used.
|
||||
* @return array Array of page templates, keyed by filename, with the value of the translated header name.
|
||||
* @return string[] Array of template header names keyed by the template file name.
|
||||
*/
|
||||
public function get_page_templates( $post = null, $post_type = 'page' ) {
|
||||
if ( $post ) {
|
||||
|
@ -1248,8 +1248,7 @@ final class WP_Theme implements ArrayAccess {
|
|||
*
|
||||
* @since 4.9.6
|
||||
*
|
||||
* @param string[] $post_templates Array of page templates. Keys are filenames,
|
||||
* values are translated names.
|
||||
* @param string[] $post_templates Array of template header names keyed by the template file name.
|
||||
* @param WP_Theme $this The theme object.
|
||||
* @param WP_Post|null $post The post being edited, provided for context, or null.
|
||||
* @param string $post_type Post type to get the templates for.
|
||||
|
@ -1265,8 +1264,7 @@ final class WP_Theme implements ArrayAccess {
|
|||
* @since 4.4.0 Converted to allow complete control over the `$page_templates` array.
|
||||
* @since 4.7.0 Added the `$post_type` parameter.
|
||||
*
|
||||
* @param string[] $post_templates Array of page templates. Keys are filenames,
|
||||
* values are translated names.
|
||||
* @param string[] $post_templates Array of template header names keyed by the template file name.
|
||||
* @param WP_Theme $this The theme object.
|
||||
* @param WP_Post|null $post The post being edited, provided for context, or null.
|
||||
* @param string $post_type Post type to get the templates for.
|
||||
|
@ -1289,7 +1287,7 @@ final class WP_Theme implements ArrayAccess {
|
|||
* @param string $relative_path Optional. The basename of the absolute path. Used to control the
|
||||
* returned path for the found files, particularly when this function
|
||||
* recurses to lower depths. Default empty.
|
||||
* @return array|false Array of files, keyed by the path to the file relative to the `$path` directory prepended
|
||||
* @return string[]|false Array of files, keyed by the path to the file relative to the `$path` directory prepended
|
||||
* with `$relative_path`, with the values being absolute paths. False otherwise.
|
||||
*/
|
||||
private static function scandir( $path, $extensions = null, $depth = 0, $relative_path = '' ) {
|
||||
|
|
|
@ -864,7 +864,8 @@ class WP_User {
|
|||
*
|
||||
* @since 4.9.0
|
||||
*
|
||||
* @return array User capabilities array.
|
||||
* @return bool[] List of capabilities keyed by the capability name,
|
||||
* e.g. array( 'edit_posts' => true, 'delete_posts' => false ).
|
||||
*/
|
||||
private function get_caps_data() {
|
||||
$caps = get_user_meta( $this->ID, $this->cap_key, true );
|
||||
|
|
|
@ -25,26 +25,26 @@ class WP_Dependencies {
|
|||
public $registered = array();
|
||||
|
||||
/**
|
||||
* An array of queued _WP_Dependency handle objects.
|
||||
* An array of handles of queued objects.
|
||||
*
|
||||
* @since 2.6.8
|
||||
* @var array
|
||||
* @var string[]
|
||||
*/
|
||||
public $queue = array();
|
||||
|
||||
/**
|
||||
* An array of _WP_Dependency handle objects to queue.
|
||||
* An array of handles of objects to queue.
|
||||
*
|
||||
* @since 2.6.0
|
||||
* @var array
|
||||
* @var string[]
|
||||
*/
|
||||
public $to_do = array();
|
||||
|
||||
/**
|
||||
* An array of _WP_Dependency handle objects already queued.
|
||||
* An array of handles of objects already queued.
|
||||
*
|
||||
* @since 2.6.0
|
||||
* @var array
|
||||
* @var string[]
|
||||
*/
|
||||
public $done = array();
|
||||
|
||||
|
@ -84,8 +84,8 @@ class WP_Dependencies {
|
|||
* @since 2.8.0 Added the `$group` parameter.
|
||||
*
|
||||
* @param mixed $handles Optional. Items to be processed: Process queue (false), process item (string), process items (array of strings).
|
||||
* @param mixed $group Group level: level (int), no groups (false).
|
||||
* @return array Handles of items that have been processed.
|
||||
* @param int|false $group Optional. Group level: level (int), no groups (false).
|
||||
* @return string[] Array of handles of items that have been processed.
|
||||
*/
|
||||
public function do_items( $handles = false, $group = false ) {
|
||||
/*
|
||||
|
@ -136,7 +136,7 @@ class WP_Dependencies {
|
|||
* @since 2.6.0 Moved from `WP_Scripts`.
|
||||
* @since 2.8.0 Added the `$group` parameter.
|
||||
*
|
||||
* @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings).
|
||||
* @param string|string[] $handles Item handle and argument (string) or item handles and arguments (array of strings).
|
||||
* @param bool $recursion Internal flag that function is calling itself.
|
||||
* @param int|false $group Group level: (int) level, (false) no groups.
|
||||
* @return bool True on success, false on failure.
|
||||
|
@ -270,7 +270,7 @@ class WP_Dependencies {
|
|||
* @since 2.1.0
|
||||
* @since 2.6.0 Moved from `WP_Scripts`.
|
||||
*
|
||||
* @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings).
|
||||
* @param string|string[] $handles Item handle and argument (string) or item handles and arguments (array of strings).
|
||||
* @return void
|
||||
*/
|
||||
public function remove( $handles ) {
|
||||
|
@ -290,7 +290,7 @@ class WP_Dependencies {
|
|||
* @since 2.1.0
|
||||
* @since 2.6.0 Moved from `WP_Scripts`.
|
||||
*
|
||||
* @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings).
|
||||
* @param string|string[] $handles Item handle and argument (string) or item handles and arguments (array of strings).
|
||||
*/
|
||||
public function enqueue( $handles ) {
|
||||
foreach ( (array) $handles as $handle ) {
|
||||
|
@ -313,7 +313,7 @@ class WP_Dependencies {
|
|||
* @since 2.1.0
|
||||
* @since 2.6.0 Moved from `WP_Scripts`.
|
||||
*
|
||||
* @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings).
|
||||
* @param string|string[] $handles Item handle and argument (string) or item handles and arguments (array of strings).
|
||||
*/
|
||||
public function dequeue( $handles ) {
|
||||
foreach ( (array) $handles as $handle ) {
|
||||
|
|
|
@ -177,9 +177,9 @@ class WP_Scripts extends WP_Dependencies {
|
|||
*
|
||||
* @param mixed $handles Optional. Scripts to be printed. (void) prints queue, (string) prints
|
||||
* that script, (array of strings) prints those scripts. Default false.
|
||||
* @param int $group Optional. If scripts were queued in groups prints this group number.
|
||||
* @param int|false $group Optional. If scripts were queued in groups prints this group number.
|
||||
* Default false.
|
||||
* @return array Scripts that have been printed.
|
||||
* @return string[] Handles of scripts that have been printed.
|
||||
*/
|
||||
public function print_scripts( $handles = false, $group = false ) {
|
||||
return $this->do_items( $handles, $group );
|
||||
|
@ -627,7 +627,7 @@ JS;
|
|||
*
|
||||
* @see WP_Dependencies::do_items()
|
||||
*
|
||||
* @return array Handles of items that have been processed.
|
||||
* @return string[] Handles of items that have been processed.
|
||||
*/
|
||||
public function do_head_items() {
|
||||
$this->do_items( false, 0 );
|
||||
|
@ -641,7 +641,7 @@ JS;
|
|||
*
|
||||
* @see WP_Dependencies::do_items()
|
||||
*
|
||||
* @return array Handles of items that have been processed.
|
||||
* @return string[] Handles of items that have been processed.
|
||||
*/
|
||||
public function do_footer_items() {
|
||||
$this->do_items( false, 1 );
|
||||
|
|
|
@ -356,7 +356,7 @@ class WP_Styles extends WP_Dependencies {
|
|||
*
|
||||
* @see WP_Dependencies::all_deps()
|
||||
*
|
||||
* @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings).
|
||||
* @param string|string[] $handles Item handle and argument (string) or item handles and arguments (array of strings).
|
||||
* @param bool $recursion Internal flag that function is calling itself.
|
||||
* @param int|false $group Group level: (int) level, (false) no groups.
|
||||
* @return bool True on success, false on failure.
|
||||
|
@ -437,7 +437,7 @@ class WP_Styles extends WP_Dependencies {
|
|||
*
|
||||
* @see WP_Dependencies::do_items()
|
||||
*
|
||||
* @return array Handles of items that have been processed.
|
||||
* @return string[] Handles of items that have been processed.
|
||||
*/
|
||||
public function do_footer_items() {
|
||||
$this->do_items( false, 1 );
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.4-alpha-46660';
|
||||
$wp_version = '5.4-alpha-46661';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue