Make WordPress Core

Changeset 62721


Ignore:
Timestamp:
07/14/2026 05:41:49 AM (6 weeks ago)
Author:
westonruter
Message:

Docs: Add specific types to WP_Network_Query properties.

Replace the generic array type in the docblocks for the $sql_clauses, $query_vars, $query_var_defaults, and $networks properties with specific types, including an array shape for $sql_clauses and WP_Network[]|int[] for $networks. Additionally, document the $found_networks and $max_num_pages counts as non-negative-int.

Developed in https://github.com/WordPress/wordpress-develop/pull/11663.
Follow-up to r37894.

Props baikaresandeep007-1, westonruter.
See #64896.
Fixes #65118.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-network-query.php

    r61403 r62721  
    3030         *
    3131         * @since 4.6.0
    32          * @var array
     32         * @var array{
     33         *     select: string,
     34         *     from: string,
     35         *     where: array<string, string>,
     36         *     groupby: string,
     37         *     orderby: string,
     38         *     limits: string
     39         * }
    3340         */
    3441        protected $sql_clauses = array(
     
    4552         *
    4653         * @since 4.6.0
    47          * @var array
     54         * @var array<string, mixed>
    4855         */
    4956        public $query_vars;
     
    5360         *
    5461         * @since 4.6.0
    55          * @var array
     62         * @var array<string, mixed>
    5663         */
    5764        public $query_var_defaults;
     
    6168         *
    6269         * @since 4.6.0
    63          * @var array
     70         * @var WP_Network[]|int[]
    6471         */
    6572        public $networks;
     
    7077         * @since 4.6.0
    7178         * @var int
     79         * @phpstan-var non-negative-int
    7280         */
    7381        public $found_networks = 0;
     
    7886         * @since 4.6.0
    7987         * @var int
     88         * @phpstan-var non-negative-int
    8089         */
    8190        public $max_num_pages = 0;
Note: See TracChangeset for help on using the changeset viewer.