Skip to content

Instantly share code, notes, and snippets.

@simplethemes
Created December 12, 2014 21:11
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/7329f5d5750e7258ee39 to your computer and use it in GitHub Desktop.
Save simplethemes/7329f5d5750e7258ee39 to your computer and use it in GitHub Desktop.
function element_transport_theme_mods() {
global $wpdb;
$themedata = $wpdb->get_var($wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = %s", 'element'));
if ($themedata) {
$wpdb->update(
$wpdb->options, // table
array( 'option_value' => $themedata ), // column => data
array( 'option_name' => 'elementchild' ) // where column
);
}
$thememods = $wpdb->get_var($wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = %s", 'theme_mods_element'));
if ($thememods) {
$wpdb->update(
$wpdb->options, // table
array( 'option_value' => $thememods ), // column => data
array( 'option_name' => 'theme_mods_element-child' ) // where column
);
}
}
add_action ('after_setup_theme', 'element_transport_theme_mods');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment