确定该站点是否具有自定义徽标。
原型
has_custom_logo( int $blog_id )
参数
$blog_id
(int)
(Optional)
相关博客的ID。默认值是当前博客的ID。
返回值
(bool)
该网站是否具有自定义徽标。
源文件
路径:wp-includes/general-template.php
<?php
...
function has_custom_logo( $blog_id = 0 ) {
$switched_blog = false;
if ( is_multisite() && ! empty( $blog_id ) && (int) $blog_id !== get_current_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;
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/has_custom_logo/