Make WordPress Core

Changeset 61281


Ignore:
Timestamp:
11/23/2025 05:37:23 AM (3 months ago)
Author:
westonruter
Message:

Docs: Explicitly return null when documented instead of void in link-template.php functions.

The phpdoc @return tags for these functions indicate they may return null. This also fixes "Missing return argument" warnings which an IDE may also complain about.

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

Props justlevine.
See #64238.

File:
1 edited

Legend:

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

    r61066 r61281  
    10831083    $term = get_term( $term, $taxonomy );
    10841084    if ( ! $term || is_wp_error( $term ) ) {
    1085         return;
     1085        return null;
    10861086    }
    10871087
     
    10891089    $term_id = $term->term_id;
    10901090    if ( ! $tax || ! current_user_can( 'edit_term', $term_id ) ) {
    1091         return;
     1091        return null;
    10921092    }
    10931093
     
    14111411
    14121412    if ( ! $post ) {
    1413         return;
     1413        return null;
    14141414    }
    14151415
     
    14551455
    14561456    if ( ! $post ) {
    1457         return;
     1457        return null;
    14581458    }
    14591459
     
    14691469
    14701470    if ( ! $post_type_object ) {
    1471         return;
     1471        return null;
    14721472    }
    14731473
    14741474    if ( ! current_user_can( 'edit_post', $post->ID ) ) {
    1475         return;
     1475        return null;
    14761476    }
    14771477
Note: See TracChangeset for help on using the changeset viewer.