Make WordPress Core

Changeset 61768

Timestamp:
02/27/2026 11:28:17 PM (5 days ago)
Author:
westonruter
Message:

Code Quality: Replace void with null in union return types in general-template.php.

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

Follow-up to r61767, r61766, r61719, r61716, r53300, r32598.

Props apermo, xate, mukesh27.
See #64238.
Fixes #64700.

File:
1 edited

Legend:

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

    r61719 r61768  
    13391339 * @param bool   $display     Optional. Whether to display or retrieve title. Default true.
    13401340 * @param string $seplocation Optional. Location of the separator (either 'left' or 'right').
    1341  * @return string|void String when `$display` is false, nothing otherwise.
     1341 * @return string| otherwise.
    13421342 */
    13431343function wp_title( $sep = '»', $display = true, $seplocation = '' ) {
     
    14901490 * @param string $prefix  Optional. What to display before the title.
    14911491 * @param bool   $display Optional. Whether to display or retrieve title. Default true.
    1492  * @return string|void Title when retrieving.
     1492 * @return string| Title when retrieving.
    14931493 */
    14941494function single_post_title( $prefix = '', $display = true ) {
     
    14961496
    14971497    if ( ! isset( $_post->post_title ) ) {
    1498         return;
     1498        return;
    14991499    }
    15001500
     
    15251525 * @param string $prefix  Optional. What to display before the title.
    15261526 * @param bool   $display Optional. Whether to display or retrieve title. Default true.
    1527  * @return string|void Title when retrieving, null when displaying or failure.
     1527 * @return string| failure.
    15281528 */
    15291529function post_type_archive_title( $prefix = '', $display = true ) {
    15301530    if ( ! is_post_type_archive() ) {
    1531         return;
     1531        return;
    15321532    }
    15331533
     
    15671567 * @param string $prefix  Optional. What to display before the title.
    15681568 * @param bool   $display Optional. Whether to display or retrieve title. Default true.
    1569  * @return string|void Title when retrieving.
     1569 * @return string| Title when retrieving.
    15701570 */
    15711571function single_cat_title( $prefix = '', $display = true ) {
     
    15841584 * @param string $prefix  Optional. What to display before the title.
    15851585 * @param bool   $display Optional. Whether to display or retrieve title. Default true.
    1586  * @return string|void Title when retrieving.
     1586 * @return string| Title when retrieving.
    15871587 */
    15881588function single_tag_title( $prefix = '', $display = true ) {
     
    16011601 * @param string $prefix  Optional. What to display before the title.
    16021602 * @param bool   $display Optional. Whether to display or retrieve title. Default true.
    1603  * @return string|void Title when retrieving.
     1603 * @return string| Title when retrieving.
    16041604 */
    16051605function single_term_title( $prefix = '', $display = true ) {
     
    16071607
    16081608    if ( ! $term ) {
    1609         return;
     1609        return;
    16101610    }
    16111611
     
    16381638        $term_name = apply_filters( 'single_term_title', $term->name );
    16391639    } else {
    1640         return;
     1640        return;
    16411641    }
    16421642
    16431643    if ( empty( $term_name ) ) {
    1644         return;
     1644        return;
    16451645    }
    16461646
     
    16661666 * @param string $prefix  Optional. What to display before the title.
    16671667 * @param bool   $display Optional. Whether to display or retrieve title. Default true.
    1668  * @return string|false|void False if there's no valid title for the month. Title when retrieving.
     1668 * @return string|false| False if there's no valid title for the month. Title when retrieving.
    16691669 */
    16701670function single_month_title( $prefix = '', $display = true ) {
     
    26822682 * @param string $after   Optional. Output after the date. Default empty.
    26832683 * @param bool   $display Optional. Whether to echo the date or return it. Default true.
    2684  * @return string|void String if retrieving.
     2684 * @return string| String if retrieving.
    26852685 */
    26862686function the_date( $format = '', $before = '', $after = '', $display = true ) {
     
    27572757 * @param string $after   Optional. Output after the date. Default empty.
    27582758 * @param bool   $display Optional. Whether to echo the date or return it. Default true.
    2759  * @return string|void String if retrieving.
     2759 * @return string| String if retrieving.
    27602760 */
    27612761function the_modified_date( $format = '', $before = '', $after = '', $display = true ) {
     
    51675167 *
    51685168 * @param string $type The type of generator to return - (html|xhtml|atom|rss2|rdf|comment|export).
    5169  * @return string|void The HTML content for the generator.
     5169 * @return string| The HTML content for the generator.
    51705170 */
    51715171function get_the_generator( $type = '' ) {
     
    51745174        $current_filter = current_filter();
    51755175        if ( empty( $current_filter ) ) {
    5176             return;
     5176            return;
    51775177        }
    51785178
Note: See TracChangeset for help on using the changeset viewer.