wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



_sync_site_logo_to_custom_logo › WordPress Function

Seitn/v
Veraltetn/v
_sync_site_logo_to_custom_logo ( $old_value, $value )
Parameter: (2)
  • (mixed) $old_value The old option value.
    Erforderlich: Ja
  • (mixed) $value The new option value.
    Erforderlich: Ja
Gibt zurück:
  • (void)
Definiert in:
Codex:

Updates the custom_logo theme-mod when the site_logo option gets updated.



Quellcode

function _sync_site_logo_to_custom_logo( $old_value, $value ) {
	// Delete the option when the custom logo does not exist or was removed.
	// This step ensures the option stays in sync.
	if ( empty( $value ) ) {
		remove_theme_mod( 'custom_logo' );
	} else {
		remove_filter( 'pre_set_theme_mod_custom_logo', '_sync_custom_logo_to_site_logo' );
		set_theme_mod( 'custom_logo', $value );
		add_filter( 'pre_set_theme_mod_custom_logo', '_sync_custom_logo_to_site_logo' );
	}
}