Make WordPress Core


Ignore:
Timestamp:
02/15/2026 11:17:55 PM (4 months ago)
Author:
SergeyBiryukov
Message:

Docs: Add missing null to $post parameter types in various functions.

Props apermo.
Fixes #64645.

File:
1 edited

Legend:

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

    r61445 r61649  
    408408 * @since 4.5.0 Introduced the `$post` parameter.
    409409 *
    410  * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
     410 * @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default is global $post.
    411411 * @return string Post excerpt.
    412412 */
     
    459459 * @since 2.7.0
    460460 *
    461  * @param string|string[] $css_class Optional. One or more classes to add to the class list.
    462  *                                   Default empty.
    463  * @param int|WP_Post    $post      Optional. Post ID or post object. Defaults to the global `$post`.
     461 * @param string|string[]  $css_class Optional. One or more classes to add to the class list.
     462 *                                    Default empty.
     463 * @param int|WP_Post|null $post      Optional. Post ID or post object. Defaults to the global `$post`.
    464464 */
    465465function post_class( $css_class = '', $post = null ) {
     
    487487 * @since 4.2.0 Custom taxonomy class names were added.
    488488 *
    489  * @param string|string[] $css_class Optional. Space-separated string or array of class names
    490  *                                   to add to the class list. Default empty.
    491  * @param int|WP_Post    $post      Optional. Post ID or post object.
     489 * @param string|string[]  $css_class Optional. Space-separated string or array of class names
     490 *                                    to add to the class list. Default empty.
     491 * @param int|WP_Post|null $post      Optional. Post ID or post object.
    492492 * @return string[] Array of class names.
    493493 */
     
    18841884 * @since 4.7.0 Now works with any post type, not just pages.
    18851885 *
    1886  * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
     1886 * @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default is global $post.
    18871887 * @return string|false Page template filename. Returns an empty string when the default page template
    18881888 *                      is in use. Returns false if the post does not exist.
Note: See TracChangeset for help on using the changeset viewer.