_override_custom_logo_theme_mod

函式
_override_custom_logo_theme_mod ( $custom_logo )
引數
  • (string) $custom_logo The custom logo set by a theme.
    Required:
返回值
  • (string) The site logo if set.
定義位置
相關方法
_delete_custom_logo_on_remove_site_logo_sync_custom_logo_to_site_logothe_custom_logoget_custom_logo_custom_logo_header_styles
引入
-
棄用
-

_override_custom_logo_theme_mod: 這個函式是用來覆蓋WordPress中的自定義標誌主題模組的。它需要兩個引數,$value和$option。$value是自定義徽標的新值,而$option是選項名稱: 當你想以程式設計方式為一個主題設定一個新的標誌時,這個函式經常被使用。

如果設定了該選項,則用網站標誌覆蓋自定義標誌。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function _override_custom_logo_theme_mod( $custom_logo ) {
$site_logo = get_option( 'site_logo' );
return false === $site_logo ? $custom_logo : $site_logo;
}
function _override_custom_logo_theme_mod( $custom_logo ) { $site_logo = get_option( 'site_logo' ); return false === $site_logo ? $custom_logo : $site_logo; }
function _override_custom_logo_theme_mod( $custom_logo ) {
	$site_logo = get_option( 'site_logo' );
	return false === $site_logo ? $custom_logo : $site_logo;
}

常見問題

FAQs
檢視更多 >