mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
Docs: Switch more docs over to typed array notation, plus some fixes.
See #48303, #41756 git-svn-id: https://develop.svn.wordpress.org/trunk@46596 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 int $site_id Site ID.
|
||||
* @param int $network_id Network ID.
|
||||
* @param object $user WP_User object.
|
||||
* @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 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 ) ) {
|
||||
|
||||
@@ -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 $taxonomy Taxonomy name.
|
||||
* @param array $terms Array of terms appearing in the post row.
|
||||
* @param string[] $term_links Array of term editing links.
|
||||
* @param string $taxonomy Taxonomy name.
|
||||
* @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 );
|
||||
|
||||
|
||||
@@ -705,10 +705,10 @@ final class WP_Privacy_Policy_Content {
|
||||
* @since 4.9.6
|
||||
* @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 bool $description Whether policy descriptions should be included.
|
||||
* @param bool $blocks Whether the content should be formatted for the block editor.
|
||||
* @param string $content The default policy content.
|
||||
* @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.
|
||||
*/
|
||||
return apply_filters( 'wp_get_default_privacy_policy_content', $content, $strings, $description, $blocks );
|
||||
}
|
||||
|
||||
@@ -175,11 +175,11 @@ 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
|
||||
* not exist, a WP_Error object will be returned.
|
||||
* Default empty array.
|
||||
* @param bool $allow_relaxed_file_ownership Whether to allow relaxed file ownership.
|
||||
* Default false.
|
||||
* @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.
|
||||
* Default false.
|
||||
* @return bool|WP_Error True if able to connect, false or a WP_Error otherwise.
|
||||
*/
|
||||
public function fs_connect( $directories = array(), $allow_relaxed_file_ownership = false ) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
@@ -1449,9 +1449,9 @@ function unzip_file( $file, $to ) {
|
||||
*
|
||||
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
|
||||
*
|
||||
* @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 $file Full path and filename of ZIP archive.
|
||||
* @param string $to Full path on the filesystem to extract archive to.
|
||||
* @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() ) {
|
||||
@@ -1580,9 +1580,9 @@ function _unzip_file_ziparchive( $file, $to, $needed_dirs = array() ) {
|
||||
*
|
||||
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
|
||||
*
|
||||
* @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 $file Full path and filename of ZIP archive.
|
||||
* @param string $to Full path on the filesystem to extract archive to.
|
||||
* @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() ) {
|
||||
@@ -1691,9 +1691,9 @@ function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) {
|
||||
*
|
||||
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
|
||||
*
|
||||
* @param string $from Source directory.
|
||||
* @param string $to Destination directory.
|
||||
* @param array $skip_list A list of files/folders to skip copying.
|
||||
* @param string $from Source directory.
|
||||
* @param string $to Destination directory.
|
||||
* @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() ) {
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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() );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user