mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
There are a few functions that have the ability to return false instead of a string, so the return value should be checked before being passed to functions that expect string.
These are trivial, but they clear out some Scrutinizer issues. See #30799. git-svn-id: https://develop.svn.wordpress.org/trunk@31681 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1050,7 +1050,7 @@ function has_header_image() {
|
||||
*
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @return string
|
||||
* @return string|false
|
||||
*/
|
||||
function get_header_image() {
|
||||
$url = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) );
|
||||
@@ -1153,7 +1153,10 @@ function is_random_header_image( $type = 'any' ) {
|
||||
* @since 2.1.0
|
||||
*/
|
||||
function header_image() {
|
||||
echo esc_url( get_header_image() );
|
||||
$image = get_header_image();
|
||||
if ( $image ) {
|
||||
echo esc_url( $image );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user