Created
December 17, 2014 00:24
-
-
Save simplethemes/8e416652a79899db4bd4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function st_transport_theme_mods() { | |
global $wpdb; | |
$themetitle = 'synapse'; | |
$themedata = $wpdb->get_var($wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = %s", $themetitle)); | |
if ($themedata) { | |
$wpdb->update( | |
$wpdb->options, // table | |
array( 'option_value' => $themedata ), // column => data | |
array( 'option_name' => $themetitle.'child' ) // where column | |
); | |
} | |
$thememods = $wpdb->get_var($wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = %s", 'theme_mods_'.$themetitle)); | |
if ($thememods) { | |
$wpdb->update( | |
$wpdb->options, // table | |
array( 'option_value' => $thememods ), // column => data | |
array( 'option_name' => 'theme_mods_'.$themetitle.'-child' ) // where column | |
); | |
} | |
} | |
add_action ('after_setup_theme', 'st_transport_theme_mods'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment