WordPress函数:has_site_icon

一、函数简介

has_site_icon该函数用于确定网站是否有网站图标。

 

二、函数参数

  • @param int $blog_id Optional. ID of the blog in question. Default current blog.
  • @return bool Whether the site has a site icon or not.

 

三、函数案例

(一)、案例1

<?php echo has_site_icon( $blog_id = 0 ) ?>

直接执行该函数判断是否图标。

1表示有网站图标

0表示无网站图标

 

 

四、源代码

/**
 * Determines whether the site has a Site Icon.
 *
 * @since 4.3.0
 *
 * @param int $blog_id Optional. ID of the blog in question. Default current blog.
 * @return bool Whether the site has a site icon or not.
 */
function has_site_icon( $blog_id = 0 ) {
	return (bool) get_site_icon_url( 512, '', $blog_id );
}

 

 

THE END