Exemple #1
0
function sds_after_setup_theme_custom_logo_compatibility()
{
    global $sds_theme_options;
    // Bail if we don't have options stored in the database
    if (!SDS_Theme_Options::has_options()) {
        return;
    }
    // If this is WordPress 4.5 and up and we have a old logo
    if (SDS_Theme_Options::wp_version_compare('4.5') && !empty($sds_theme_options['logo_attachment_id'])) {
        /*
         * Store the SDS Theme Options logo attachment ID in the new custom_logo theme mod
         * to ensure forwards compatibility. Also remove the SDS Theme Options logo attachment ID
         * as it is no longer necessary.
         */
        // Update the custom_logo theme mod
        set_theme_mod('custom_logo', $sds_theme_options['logo_attachment_id']);
        // Unset the SDS Theme Options logo attachment ID
        $sds_theme_options['logo_attachment_id'] = false;
        // Update SDS Theme Options
        update_option(SDS_Theme_Options::get_option_name(), $sds_theme_options);
    }
}