_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选项。

function _sync_custom_logo_to_site_logo( $value ) {
	if ( empty( $value ) ) {
		delete_option( 'site_logo' );
	} else {
		update_option( 'site_logo', $value );
	}

	return $value;
}

常见问题

FAQs
查看更多 >