Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@simplethemes
Created December 17, 2014 00:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simplethemes/8e416652a79899db4bd4 to your computer and use it in GitHub Desktop.
Save simplethemes/8e416652a79899db4bd4 to your computer and use it in GitHub Desktop.
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