Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions src/wp-includes/general-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -1338,7 +1338,7 @@ function _wp_render_title_tag() {
* Default '»'.
* @param bool $display Optional. Whether to display or retrieve title. Default true.
* @param string $seplocation Optional. Location of the separator (either 'left' or 'right').
* @return string|void String when `$display` is false, nothing otherwise.
* @return string|null String when `$display` is false, null otherwise.
*/
function wp_title( $sep = '»', $display = true, $seplocation = '' ) {
global $wp_locale;
Expand Down Expand Up @@ -1489,13 +1489,13 @@ function wp_title( $sep = '»', $display = true, $seplocation = '' ) {
*
* @param string $prefix Optional. What to display before the title.
* @param bool $display Optional. Whether to display or retrieve title. Default true.
* @return string|void Title when retrieving.
* @return string|null Title when retrieving.
*/
function single_post_title( $prefix = '', $display = true ) {
$_post = get_queried_object();

if ( ! isset( $_post->post_title ) ) {
return;
return null;
}

/**
Expand Down Expand Up @@ -1524,11 +1524,11 @@ function single_post_title( $prefix = '', $display = true ) {
*
* @param string $prefix Optional. What to display before the title.
* @param bool $display Optional. Whether to display or retrieve title. Default true.
* @return string|void Title when retrieving, null when displaying or failure.
* @return string|null Title when retrieving, null when displaying or on failure.
*/
function post_type_archive_title( $prefix = '', $display = true ) {
if ( ! is_post_type_archive() ) {
return;
return null;
}

$post_type = get_query_var( 'post_type' );
Expand Down Expand Up @@ -1566,7 +1566,7 @@ function post_type_archive_title( $prefix = '', $display = true ) {
*
* @param string $prefix Optional. What to display before the title.
* @param bool $display Optional. Whether to display or retrieve title. Default true.
* @return string|void Title when retrieving.
* @return string|null Title when retrieving.
*/
function single_cat_title( $prefix = '', $display = true ) {
return single_term_title( $prefix, $display );
Expand All @@ -1583,7 +1583,7 @@ function single_cat_title( $prefix = '', $display = true ) {
*
* @param string $prefix Optional. What to display before the title.
* @param bool $display Optional. Whether to display or retrieve title. Default true.
* @return string|void Title when retrieving.
* @return string|null Title when retrieving.
*/
function single_tag_title( $prefix = '', $display = true ) {
return single_term_title( $prefix, $display );
Expand All @@ -1600,13 +1600,13 @@ function single_tag_title( $prefix = '', $display = true ) {
*
* @param string $prefix Optional. What to display before the title.
* @param bool $display Optional. Whether to display or retrieve title. Default true.
* @return string|void Title when retrieving.
* @return string|null Title when retrieving.
*/
function single_term_title( $prefix = '', $display = true ) {
$term = get_queried_object();

if ( ! $term ) {
return;
return null;
}

if ( is_category() ) {
Expand Down Expand Up @@ -1637,11 +1637,11 @@ function single_term_title( $prefix = '', $display = true ) {
*/
$term_name = apply_filters( 'single_term_title', $term->name );
} else {
return;
return null;
}

if ( empty( $term_name ) ) {
return;
return null;
}

if ( $display ) {
Expand All @@ -1665,7 +1665,7 @@ function single_term_title( $prefix = '', $display = true ) {
*
* @param string $prefix Optional. What to display before the title.
* @param bool $display Optional. Whether to display or retrieve title. Default true.
* @return string|false|void False if there's no valid title for the month. Title when retrieving.
* @return string|false|null False if there's no valid title for the month. Title when retrieving.
*/
function single_month_title( $prefix = '', $display = true ) {
global $wp_locale;
Expand Down Expand Up @@ -2681,7 +2681,7 @@ function the_date_xml() {
* @param string $before Optional. Output before the date. Default empty.
* @param string $after Optional. Output after the date. Default empty.
* @param bool $display Optional. Whether to echo the date or return it. Default true.
* @return string|void String if retrieving.
* @return string|null String if retrieving.
*/
function the_date( $format = '', $before = '', $after = '', $display = true ) {
global $currentday, $previousday;
Expand Down Expand Up @@ -2756,7 +2756,7 @@ function get_the_date( $format = '', $post = null ) {
* @param string $before Optional. Output before the date. Default empty.
* @param string $after Optional. Output after the date. Default empty.
* @param bool $display Optional. Whether to echo the date or return it. Default true.
* @return string|void String if retrieving.
* @return string|null String if retrieving.
*/
function the_modified_date( $format = '', $before = '', $after = '', $display = true ) {
$the_modified_date = $before . get_the_modified_date( $format ) . $after;
Expand Down Expand Up @@ -5166,14 +5166,14 @@ function the_generator( $type ) {
* @since 2.5.0
*
* @param string $type The type of generator to return - (html|xhtml|atom|rss2|rdf|comment|export).
* @return string|void The HTML content for the generator.
* @return string|null The HTML content for the generator.
*/
function get_the_generator( $type = '' ) {
if ( empty( $type ) ) {

$current_filter = current_filter();
if ( empty( $current_filter ) ) {
return;
return null;
}

switch ( $current_filter ) {
Expand Down
Loading