From e7bf16b423951de9e26bf02a0cbc2c54b603a243 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 17 Jan 2015 06:33:42 +0000 Subject: [PATCH] Introduce has_header_image() to check whether a header image is set. props GunGeekATX, voldemortensen. fixes #16268. git-svn-id: https://develop.svn.wordpress.org/trunk@31224 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/theme.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php index 7a233b2e88..3f5b5e7455 100644 --- a/src/wp-includes/theme.php +++ b/src/wp-includes/theme.php @@ -1034,6 +1034,17 @@ function display_header_text() { return 'blank' != $text_color; } +/** + * Check whether a header image is set or not. + * + * @since 4.2.0 + * + * @return bool + */ +function has_header_image() { + return (bool) get_header_image(); +} + /** * Retrieve header image for custom header. *