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:
Scott Taylor
2015-03-09 02:10:36 +00:00
parent 7103ef6018
commit 3c810c5872
9 changed files with 33 additions and 12 deletions
+5 -2
View File
@@ -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 );
}
}
/**