Make WordPress Core

Changeset 61594


Ignore:
Timestamp:
02/07/2026 06:05:09 AM (8 months ago)
Author:
westonruter
Message:

Docs: Add descriptions and improved typing to @return tags in various admin and includes files.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/10863

Props huzaifaalmesbah, westonruter, noruzzaman, mukesh27.
See #64224.

Location:
trunk/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-debug-data.php

    r61577 r61594  
    143143         * @since 6.7.0
    144144         *
    145          * @return array
     145         * @return array<string, string|array> The debug data for the Info screen.
    146146         */
    147147        private static function get_wp_core(): array {
    … …  
    306306         * @since 6.7.0
    307307         *
    308          * @return array
     308         * @return array<string, string|bool|array> The drop-ins debug data.
    309309         */
    310310        private static function get_wp_dropins(): array {
    … …  
    341341         * @since 6.7.0
    342342         *
    343          * @return array
     343         * @return array<string, string|array> The server-related debug data.
    344344         */
    345345        private static function get_wp_server(): array {
    … …  
    562562         *
    563563         * @throws ImagickException
    564          * @return array
     564         * @return array<string, string|array> The media handling debug data.
    565565         */
    566566        private static function get_wp_media(): array {
    … …  
    774774         * @since 6.7.0
    775775         *
    776          * @return array
     776         * @return array<string, string|bool|array> The must-use plugins debug data.
    777777         */
    778778        private static function get_wp_mu_plugins(): array {
    … …  
    905905         * @since 6.7.0
    906906         *
    907          * @return array
     907         * @return array<string, string|bool|array> The active plugins debug data.
    908908         */
    909909        private static function get_wp_plugins_active(): array {
    … …  
    920920         * @since 6.7.0
    921921         *
    922          * @return array
     922         * @return array<string, string|bool|array> The inactive plugins debug data.
    923923         */
    924924        private static function get_wp_plugins_inactive(): array {
    … …  
    935935         * @since 6.7.0
    936936         *
    937          * @return array
     937         * @return array<string, array<string, array<string, string>>> The raw plugin debug data for active and inactive plugins.
    938938         */
    939939        private static function get_wp_plugins_raw_data(): array {
    … …  
    10581058         * @global array $_wp_theme_features
    10591059         *
    1060          * @return array
     1060         * @return array<string, string|array> The active theme debug data.
    10611061         */
    10621062        private static function get_wp_active_theme(): array {
    … …  
    12021202         * @since 6.7.0
    12031203         *
    1204          * @return array
     1204         * @return array<string, string|array> The parent theme debug data.
    12051205         */
    12061206        private static function get_wp_parent_theme(): array {
    … …  
    13141314         * @since 6.7.0
    13151315         *
    1316          * @return array
     1316         * @return array<string, string|bool|array> The inactive themes debug data.
    13171317         */
    13181318        private static function get_wp_themes_inactive(): array {
    … …  
    14451445         * @since 6.7.0
    14461446         *
    1447          * @return array
     1447         * @return array<string, string|array> The WordPress constants debug data.
    14481448         */
    14491449        private static function get_wp_constants(): array {
    … …  
    16141614         * @global wpdb $wpdb WordPress database abstraction object.
    16151615         *
    1616          * @return array
     1616         * @return array<string, string|array> The database debug data.
    16171617         */
    16181618        private static function get_wp_database(): array {
    … …  
    16961696         * @since 6.7.0
    16971697         *
    1698          * @return array
     1698         * @return array<string, string|array> The debug data and other information for the Info screen.
    16991699         */
    17001700        private static function get_wp_filesystem(): array {
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r61524 r61594  
    353353         * @since 3.1.0
    354354         *
    355          * @return bool
     355         * @return bool Whether the table has items to display.
    356356         */
    357357        public function has_items() {
    … …  
    491491         * @since 3.1.0
    492492         *
    493          * @return array
     493         * @return array<string, string> An associative array of views.
    494494         */
    495495        protected function get_views() {
    … …  
    555555         * @since 5.6.0 A bulk action can now contain an array of options in order to create an optgroup.
    556556         *
    557          * @return array
     557         * @return array<string, string|array<string, string>> An associative array of bulk actions.
    558558         */
    559559        protected function get_bulk_actions() {
    … …  
    955955         * @since 3.1.0
    956956         *
    957          * @return int
     957         * @return int Current page number.
    958958         */
    959959        public function get_pagenum() {
    … …  
    974974         * @param string $option        User option name.
    975975         * @param int    $default_value Optional. The number of items to display. Default 20.
    976          * @return int
     976         * @return int Number of items to display per page.
    977977         */
    978978        protected function get_items_per_page( $option, $default_value = 20 ) {
    … …  
    11801180         * @abstract
    11811181         *
    1182          * @return array
     1182         * @return array<string, string> An associative array of columns.
    11831183         */
    11841184        public function get_columns() {
    … …  
    12031203         * @since 6.3.0 Added 'abbr', 'orderby-text' and 'initially-sorted-column-order'.
    12041204         *
    1205          * @return array
     1205         * @return array<string, array<int, string|bool>|string> An associative array of sortable columns.
    12061206         */
    12071207        protected function get_sortable_columns() {
    … …  
    12941294         * @since 3.1.0
    12951295         *
    1296          * @return array
     1296         * @return array<int, array|string> Column information.
    12971297         */
    12981298        protected function get_column_info() {
    … …  
    13771377         * @since 3.1.0
    13781378         *
    1379          * @return int
     1379         * @return int The number of visible columns.
    13801380         */
    13811381        public function get_column_count() {
  • trunk/src/wp-admin/includes/class-wp-media-list-table.php

    r61453 r61594  
    5454
    5555        /**
    56          * @return bool
     56         * @return bool Whether the user can upload files.
    5757         */
    5858        public function ajax_user_can() {
    … …  
    120120         * @global array $post_mime_types
    121121         * @global array $avail_post_mime_types
    122          * @return array
     122         * @return array<string, string> An array of links for the available views.
    123123         */
    124124        protected function get_views() {
    … …  
    175175
    176176        /**
    177          * @return array
     177         * @return array<string, string> An associative array of bulk actions.
    178178         */
    179179        protected function get_bulk_actions() {
    … …  
    228228
    229229        /**
    230          * @return string
     230         * @return string|false The current action.
    231231         */
    232232        public function current_action() {
    … …  
    247247
    248248        /**
    249          * @return bool
     249         * @return bool Whether the list table has items to display.
    250250         */
    251251        public function has_items() {
    … …  
    394394
    395395        /**
    396          * @return array
     396         * @return array<string, array<int, mixed>> An array of sortable columns.
    397397         */
    398398        protected function get_sortable_columns() {
    … …  
    765765         * @param WP_Post $post
    766766         * @param string  $att_title
    767          * @return array
     767         * @return array<string, string> An array of row actions.
    768768         */
    769769        private function _get_row_actions( $post, $att_title ) {
  • trunk/src/wp-admin/includes/class-wp-screen.php

    r61470 r61594  
    989989         * @global array $wp_meta_boxes Global meta box state.
    990990         *
    991          * @return bool
     991         * @return bool Whether to show the Screen Options tab for the current screen.
    992992         */
    993993        public function show_screen_options() {
  • trunk/src/wp-admin/includes/class-wp-theme-install-list-table.php

    r59675 r61594  
    2020
    2121        /**
    22          * @return bool
     22         * @return bool Whether the user can install themes.
    2323         */
    2424        public function ajax_user_can() {
    … …  
    180180         * @global array $tabs
    181181         * @global string $tab
    182          * @return array
     182         * @return array<string, string> An array of links for the available views.
    183183         */
    184184        protected function get_views() {
  • trunk/src/wp-admin/includes/media.php

    r61532 r61594  
    869869 * @since 2.5.0
    870870 *
    871  * @return null|string
     871 * @return null|string The form handler result or null.
    872872 */
    873873function wp_media_upload_handler() {
    … …  
    10971097 * @since 2.5.0
    10981098 *
    1099  * @return string|null
     1099 * @return string|null The form handler result or null.
    11001100 */
    11011101function media_upload_gallery() {
    … …  
    11231123 * @since 2.5.0
    11241124 *
    1125  * @return string|null
     1125 * @return string|null The form handler result or null.
    11261126 */
    11271127function media_upload_library() {
    … …  
    11491149 * @param WP_Post $post
    11501150 * @param string  $checked
    1151  * @return string
     1151 * @return string HTML for the image alignment radio buttons.
    11521152 */
    11531153function image_align_input_fields( $post, $checked = '' ) {
    … …  
    11871187 * @param WP_Post     $post
    11881188 * @param bool|string $check
    1189  * @return array
     1189 * @return array<string, string> An array of data for the image size input fields.
    11901190 */
    11911191function image_size_input_fields( $post, $check = '' ) {
    … …  
    12651265 * @param WP_Post $post
    12661266 * @param string  $url_type
    1267  * @return string
     1267 * @return string HTML markup for the link URL buttons.
    12681268 */
    12691269function image_link_input_fields( $post, $url_type = '' ) {
    … …  
    13141314 * @param array  $form_fields
    13151315 * @param object $post
    1316  * @return array
     1316 * @return array<string, array<string, mixed>> The attachment form fields.
    13171317 */
    13181318function image_attachment_fields_to_edit( $form_fields, $post ) {
    … …  
    13561356 * @param int     $attachment_id
    13571357 * @param array   $attachment
    1358  * @return string
     1358 * @return string HTML markup for the media element.
    13591359 */
    13601360function image_media_send_to_editor( $html, $attachment_id, $attachment ) {
    … …  
    13811381 * @param WP_Post $post
    13821382 * @param array   $errors
    1383  * @return array
     1383 * @return array<string, array<string, mixed>> The attachment fields.
    13841384 */
    13851385function get_attachment_fields_to_edit( $post, $errors = null ) {
    … …  
    18661866
    18671867/**
     1868 * Retrieves the media markup for an attachment.
     1869 *
    18681870 * @since 3.5.0
    18691871 *
    18701872 * @param int   $attachment_id
    18711873 * @param array $args
    1872  * @return array
     1874 * @return array<string, string> An array containing the media item and its metadata.
    18731875 */
    18741876function get_compat_media_markup( $attachment_id, $args = null ) {
  • trunk/src/wp-admin/includes/misc.php

    r61591 r61594  
    820820 *
    821821 * @param string $filename The file path to the configuration file.
    822  * @return bool
     822 * @return bool Whether the rule exists.
    823823 */
    824824function iis7_rewrite_rule_exists( $filename ) {
    … …  
    853853 *
    854854 * @param string $filename Name of the configuration file.
    855  * @return bool
     855 * @return bool Whether the rule was deleted.
    856856 */
    857857function iis7_delete_rewrite_rule( $filename ) {
    … …  
    893893 * @param string $filename     The file path to the configuration file.
    894894 * @param string $rewrite_rule The XML fragment with URL Rewrite rule.
    895  * @return bool
     895 * @return bool Whether the rule was added.
    896896 */
    897897function iis7_add_rewrite_rule( $filename, $rewrite_rule ) {
  • trunk/src/wp-admin/includes/update.php

    r61455 r61594  
    3535 * @param array $options Set $options['dismissed'] to true to show dismissed upgrades too,
    3636 *                       set $options['available'] to false to skip not-dismissed updates.
    37  * @return array|false Array of the update objects on success, false on failure.
     37 * @return array<object>|false Array of the update objects on success, false on failure.
    3838 */
    3939function get_core_updates( $options = array() ) {
    … …  
    127127 * @param string $version Version string to query.
    128128 * @param string $locale  Locale to query.
    129  * @return array|false An array of checksums on success, false on failure.
     129 * @return array<string, string>|false An array of checksums on success, false on failure.
    130130 */
    131131function get_core_checksums( $version, $locale ) {
    … …  
    179179 *
    180180 * @param object $update
    181  * @return bool
     181 * @return bool True if the option was updated, false otherwise.
    182182 */
    183183function dismiss_core_update( $update ) {
    … …  
    195195 * @param string $version
    196196 * @param string $locale
    197  * @return bool
     197 * @return bool True if the option was updated, false otherwise.
    198198 */
    199199function undismiss_core_update( $version, $locale ) {
    … …  
    243243 *
    244244 * @param string $msg
    245  * @return string
     245 * @return string The core update footer message.
    246246 */
    247247function core_update_footer( $msg = '' ) {
    … …  
    298298 *
    299299 * @global string $pagenow The filename of the current screen.
    300  * @return void|false
     300 * @return void|false Void on success, false if the update nag should not be displayed.
    301301 */
    302302function update_nag() {
    … …  
    402402 * @since 2.9.0
    403403 *
    404  * @return object[]
     404 * @return array<string, object> Array of plugin objects with available updates.
    405405 */
    406406function get_plugin_updates() {
    … …  
    447447 * @param string $file        Plugin basename.
    448448 * @param array  $plugin_data Plugin information.
    449  * @return void|false
     449 * @return void|false Void on success, false if the plugin update is not available.
    450450 */
    451451function wp_plugin_update_row( $file, $plugin_data ) {
    … …  
    625625 * @since 2.9.0
    626626 *
    627  * @return WP_Theme[]
     627 * @return array<string, WP_Theme> Array of theme objects with available updates.
    628628 */
    629629function get_theme_updates() {
    … …  
    672672 * @param string   $theme_key Theme stylesheet.
    673673 * @param WP_Theme $theme     Theme object.
    674  * @return void|false
     674 * @return void|false Void on success, false if the theme update is not available.
    675675 */
    676676function wp_theme_update_row( $theme_key, $theme ) {
    … …  
    849849 * @global int $upgrading
    850850 *
    851  * @return void|false
     851 * @return void|false Void on success, false if the maintenance nag should not be displayed.
    852852 */
    853853function maintenance_nag() {
  • trunk/src/wp-includes/class-wp-http-ixr-client.php

    r61435 r61594  
    5252         *              to the function signature.
    5353         *
    54          * @return bool
     54         * @return bool True if the request succeeded, false otherwise.
    5555         */
    5656        public function query( ...$args ) {
  • trunk/src/wp-includes/vars.php

    r59688 r61594  
    159159 * @since 6.4.0 Added checking for the Sec-CH-UA-Mobile request header.
    160160 *
    161  * @return bool
     161 * @return bool Whether the request is from a mobile device.
    162162 */
    163163function wp_is_mobile() {
Note: See TracChangeset for help on using the changeset viewer.