????
| Current Path : /home2/morganrand/www/wp-content/themes/wanderfuls/framework/updates/ |
| Current File : /home2/morganrand/www/wp-content/themes/wanderfuls/framework/updates/update-3_0_0.php |
<?php
/**
* Update to Wanderfuls 3.0.0
*
* @package Wanderfuls WordPress Theme
* @subpackage Updates
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Make sure recommended plugins is enabled
set_theme_mod( 'recommend_plugins_enable', true );
// Reset customizer panels since things were modified
delete_option( 'tb_customizer_panels' );
// Reset CSS and typography cache
remove_theme_mod( 'tb_customizer_css_cache' );
remove_theme_mod( 'tb_customizer_typography_cache' ); // no longer used, lets trim things down
// Get mods
global $tb_theme_mods;
// Make sure blog entry builder has a title and meta
if ( isset( $tb_theme_mods['blog_entry_composer'] ) ) {
$blocks = $tb_theme_mods['blog_entry_composer'];
$blocks = str_replace( 'title_meta', 'title,meta', $blocks );
$blocks = str_replace( 'title_excerpt_content', 'title,meta,excerpt_content', $blocks );
set_theme_mod( 'blog_entry_composer', $blocks );
}
// Disable entry meta if was previously disabled
if ( isset( $tb_theme_mods['blog_entry_meta'] ) && ! $tb_theme_mods['blog_entry_meta'] ) {
// MUST USE THEME MOD SINCE IT GRABS FROM ABOVE
if ( $blocks = get_theme_mod( 'blog_entry_composer' ) ) {
$blocks = str_replace( 'meta,', '', $blocks );
set_theme_mod( 'blog_entry_composer', $blocks );
}
remove_theme_mod( 'blog_entry_meta' );
}
// Make sure blog single builder has a title and meta
if ( isset( $tb_theme_mods['blog_single_composer'] ) ) {
$blocks = $tb_theme_mods['blog_single_composer'];
$blocks = str_replace( 'title_meta', 'title,meta', $blocks );
$blocks = str_replace( 'title_post_series', 'title,meta', $blocks );
set_theme_mod( 'blog_single_composer', $blocks );
}
// Disable single meta if was previously disabled
if ( isset( $tb_theme_mods['blog_post_meta'] ) && ! $tb_theme_mods['blog_post_meta'] ) {
// MUST USE THEME MOD SINCE IT GRABS FROM ABOVE
if ( $blocks = get_theme_mod( 'blog_single_composer' ) ) {
$blocks = str_replace( 'meta,', '', $blocks );
set_theme_mod( 'blog_single_composer', $blocks );
}
remove_theme_mod( 'blog_post_meta' );
}
// Move tracking to options
if ( isset( $tb_theme_mods['tracking'] ) ) {
$actions = get_option( 'tb_custom_actions' );
$head_action = $actions['wp_head']['action'];
$head_action .= $tb_theme_mods['tracking'];
$actions['wp_head']['action'] = $head_action;
update_option( 'tb_custom_actions', $actions );
remove_theme_mod( 'tracking' );
}
// Update user license
if ( isset( $tb_theme_mods['envato_license_key'] ) ) {
update_option( 'tb_product_license', $tb_theme_mods['envato_license_key'] );
remove_theme_mod( 'envato_license_key' );
}
// Menu Search
if ( isset( $tb_theme_mods['main_search'] ) ) {
if ( ! $tb_theme_mods['main_search'] ) {
set_theme_mod( 'menu_search_style', 'disabled' ); // set correct menu style
set_theme_mod( 'header_aside_search', 'disabled' ); // disable header 2 search
} else {
set_theme_mod( 'menu_search_style', $tb_theme_mods['main_search'] );
}
remove_theme_mod( 'main_search' );
}
// Update social style
if ( isset( $tb_theme_mods['top_bar_social_style'] ) && 'font_icons' == $tb_theme_mods['top_bar_social_style'] ) {
set_theme_mod( 'top_bar_social_style', 'none' );
}