_sync_custom_logo_to_site_logo

函式
_sync_custom_logo_to_site_logo ( $value )
引數
  • (mixed) $value Attachment ID of the custom logo or an empty value.
    Required:
返回值
  • (mixed)
定義位置
相關方法
_delete_custom_logo_on_remove_site_logo_custom_logo_header_styles_override_custom_logo_theme_modhas_custom_logoregister_block_core_site_logo
引入
-
棄用
-

_sync_custom_logo_to_site_logo: 這個函式用於將自定義徽標同步到網站的徽標。它通常用於允許使用者上傳自定義標識的主題中: 當這個函式被呼叫時,自定義標誌被設定為與網站標誌相同。

當custom_logo theme-mod更新時,更新site_logo選項。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function _sync_custom_logo_to_site_logo( $value ) {
if ( empty( $value ) ) {
delete_option( 'site_logo' );
} else {
update_option( 'site_logo', $value );
}
return $value;
}
function _sync_custom_logo_to_site_logo( $value ) { if ( empty( $value ) ) { delete_option( 'site_logo' ); } else { update_option( 'site_logo', $value ); } return $value; }
function _sync_custom_logo_to_site_logo( $value ) {
	if ( empty( $value ) ) {
		delete_option( 'site_logo' );
	} else {
		update_option( 'site_logo', $value );
	}

	return $value;
}

常見問題

FAQs
檢視更多 >