Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.