WordPress at Your Fingertips

has_custom_logo() WP 1.0

Determines whether the site has a custom logo.

1 time — 0.000037 sec (very fast) | 50000 times — 0.59 sec (very fast) | PHP 7.0.5, WP 4.5

No Hooks.

Return

true|false. Whether the site has a custom logo or not.

Usage

has_custom_logo( $blog_id );
$blog_id(int)
ID of the blog in question.
Default: ID of the current blog

Changelog

Since 4.5.0 Introduced.

Code of has_custom_logo() WP 5.8.1

function has_custom_logo( $blog_id = 0 ) {
	$switched_blog = false;

	if ( is_multisite() && ! empty( $blog_id ) && get_current_blog_id() !== (int) $blog_id ) {
		switch_to_blog( $blog_id );
		$switched_blog = true;
	}

	$custom_logo_id = get_theme_mod( 'custom_logo' );

	if ( $switched_blog ) {
		restore_current_blog();
	}

	return (bool) $custom_logo_id;
}

custom_logo

Other Theme Functions

No comments
    Log In