Make WordPress Core

Changeset 50340


Ignore:
Timestamp:
02/13/2021 03:15:00 PM (4 years ago)
Author:
ocean90
Message:

Docs: Improve parameter types for various URL functions and filters that also accept null.

See #51800.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/link-template.php

    r50282 r50340  
    32563256 * @global string $pagenow
    32573257 *
    3258  * @param int         $blog_id Optional. Site ID. Default null (current site).
     3258 * @param int|null    $blog_id Optional. Site ID. Default null (current site).
    32593259 * @param string      $path    Optional. Path relative to the home URL. Default empty.
    32603260 * @param string|null $scheme  Optional. Scheme to give the home URL context. Accepts
     
    33133313 * @since 3.0.0
    33143314 *
    3315  * @param string $path   Optional. Path relative to the site URL. Default empty.
    3316  * @param string $scheme Optional. Scheme to give the site URL context. See set_url_scheme().
     3315 * @param string      $path   Optional. Path relative to the site URL. Default empty.
     3316 * @param string|null $scheme Optional. Scheme to give the site URL context. See set_url_scheme().
    33173317 * @return string Site URL link with optional path appended.
    33183318 */
     
    33313331 * @since 3.0.0
    33323332 *
    3333  * @param int    $blog_id Optional. Site ID. Default null (current site).
    3334  * @param string $path    Optional. Path relative to the site URL. Default empty.
    3335  * @param string $scheme  Optional. Scheme to give the site URL context. Accepts
    3336  *                        'http', 'https', 'login', 'login_post', 'admin', or
    3337  *                        'relative'. Default null.
     3333 * @param int|null    $blog_id Optional. Site ID. Default null (current site).
     3334 * @param string      $path    Optional. Path relative to the site URL. Default empty.
     3335 * @param string|null $scheme  Optional. Scheme to give the site URL context. Accepts
     3336 *                             'http', 'https', 'login', 'login_post', 'admin', or
     3337 *                             'relative'. Default null.
    33383338 * @return string Site URL link with optional path appended.
    33393339 */
     
    33723372 * @since 2.6.0
    33733373 *
    3374  * @param string $path   Optional path relative to the admin URL.
     3374 * @param string $path   Optional. Path relative to the admin URL. Default 'admin'.
    33753375 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl().
    33763376 *                       'http' or 'https' can be passed to force those schemes.
     
    33863386 * @since 3.0.0
    33873387 *
    3388  * @param int    $blog_id Optional. Site ID. Default null (current site).
    3389  * @param string $path    Optional. Path relative to the admin URL. Default empty.
    3390  * @param string $scheme  Optional. The scheme to use. Accepts 'http' or 'https',
    3391  *                        to force those schemes. Default 'admin', which obeys
    3392  *                        force_ssl_admin() and is_ssl().
     3388 * @param int|null $blog_id Optional. Site ID. Default null (current site).
     3389 * @param string   $path    Optional. Path relative to the admin URL. Default empty.
     3390 * @param string   $scheme  Optional. The scheme to use. Accepts 'http' or 'https',
     3391 *                          to force those schemes. Default 'admin', which obeys
     3392 *                          force_ssl_admin() and is_ssl().
    33933393 * @return string Admin URL link with optional path appended.
    33943394 */
     
    34173417 * @since 2.6.0
    34183418 *
    3419  * @param string $path   Optional. Path relative to the includes URL. Default empty.
    3420  * @param string $scheme Optional. Scheme to give the includes URL context. Accepts
    3421  *                       'http', 'https', or 'relative'. Default null.
     3419 * @param string      $path   Optional. Path relative to the includes URL. Default empty.
     3420 * @param string|null $scheme Optional. Scheme to give the includes URL context. Accepts
     3421 *                            'http', 'https', or 'relative'. Default null.
    34223422 * @return string Includes URL link with optional path appended.
    34233423 */
     
    35323532 * @see set_url_scheme()
    35333533 *
    3534  * @param string $path   Optional. Path relative to the site URL. Default empty.
    3535  * @param string $scheme Optional. Scheme to give the site URL context. Accepts
    3536  *                       'http', 'https', or 'relative'. Default null.
     3534 * @param string      $path   Optional. Path relative to the site URL. Default empty.
     3535 * @param string|null $scheme Optional. Scheme to give the site URL context. Accepts
     3536 *                            'http', 'https', or 'relative'. Default null.
    35373537 * @return string Site URL link with optional path appended.
    35383538 */
     
    35773577 * @since 3.0.0
    35783578 *
    3579  * @param string $path   Optional. Path relative to the home URL. Default empty.
    3580  * @param string $scheme Optional. Scheme to give the home URL context. Accepts
    3581  *                       'http', 'https', or 'relative'. Default null.
     3579 * @param string      $path   Optional. Path relative to the home URL. Default empty.
     3580 * @param string|null $scheme Optional. Scheme to give the home URL context. Accepts
     3581 *                            'http', 'https', or 'relative'. Default null.
    35823582 * @return string Home URL link with optional path appended.
    35833583 */
  • trunk/src/wp-includes/rest-api.php

    r50234 r50340  
    386386 * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
    387387 *
    388  * @param int    $blog_id Optional. Blog ID. Default of null returns URL for current blog.
    389  * @param string $path    Optional. REST route. Default '/'.
    390  * @param string $scheme  Optional. Sanitization scheme. Default 'rest'.
     388 * @param int|null $blog_id Optional. Blog ID. Default of null returns URL for current blog.
     389 * @param string   $path    Optional. REST route. Default '/'.
     390 * @param string   $scheme  Optional. Sanitization scheme. Default 'rest'.
    391391 * @return string Full URL to the endpoint.
    392392 */
     
    442442     * @since 4.4.0
    443443     *
    444      * @param string $url     REST URL.
    445      * @param string $path    REST route.
    446      * @param int    $blog_id Blog ID.
    447      * @param string $scheme  Sanitization scheme.
     444     * @param string   $url     REST URL.
     445     * @param string   $path    REST route.
     446     * @param int|null $blog_id Blog ID.
     447     * @param string   $scheme  Sanitization scheme.
    448448     */
    449449    return apply_filters( 'rest_url', $url, $path, $blog_id, $scheme );
Note: See TracChangeset for help on using the changeset viewer.