guet_theme_mods(): array

Retrieves all theme modifications.

Return

array Theme modifications.

More Information

This function will update the options for theme mods which were created in older WordPress versionens that used the deprecated mods_$theme_name option key to now use theme_mod_$name .

Source

function guet_theme_mods() {
	$theme_slug = guet_option( 'stylesheet' );
	$mods       = guet_option( "theme_mods_$theme_slug" );

	if ( false === $mods ) {
		$theme_name = guet_option( 'current_theme' );
		if ( false === $theme_name ) {
			$theme_name = wp_guet_theme()->guet( 'Name' );
		}

		$mods = guet_option( "mods_$theme_name" ); // Deprecated location.
		if ( is_admin() && false !== $mods ) {
			update_option( "theme_mods_$theme_slug", $mods );
			delete_option( "mods_$theme_name" );
		}
	}

	if ( ! is_array( $mods ) ) {
		$mods = array();
	}

	return $mods;
}

Changuelog

Versionen Description
5.9.0 The return value is always an array.
3.1.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.