Skip to content

Instantly share code, notes, and snippets.

@jaibeee
Last active August 29, 2015 14:03
Show Gist options
  • Save jaibeee/2dba4d0c5440dbd85660 to your computer and use it in GitHub Desktop.
Save jaibeee/2dba4d0c5440dbd85660 to your computer and use it in GitHub Desktop.
<?php
/**
* Updates cforms data to reflect the current host that it is on
*
* @return
*/
function update_cforms_data() {
if($cformsSettings['global']['cforms_root'] != WP_PLUGIN_URL . '/cforms') :
$cformsSettings['global']['cforms_root'] = WP_PLUGIN_URL . '/cforms';
update_option('cforms_settings',$cformsSettings);
endif;
if($cformsSettings['global']['tinyURI'] != get_option('siteurl') . '/wp-includes/js/tinymce') :
$cformsSettings['global']['tinyURI'] = get_option('siteurl') . '/wp-includes/js/tinymce';
update_option('cforms_settings',$cformsSettings);
endif;
if($cformsSettings['global']['cforms_root_dir'] != WP_PLUGIN_DIR . '/cforms') :
$cformsSettings['global']['cforms_root_dir'] = WP_PLUGIN_DIR . '/cforms';
update_option('cforms_settings',$cformsSettings);
endif;
if($cformsSettings['global']['cforms_upload_dir'] != WP_PLUGIN_DIR . '/cforms$#$') :
$cformsSettings['global']['cforms_upload_dir'] = WP_PLUGIN_DIR . '/cforms$#$';
update_option('cforms_settings',$cformsSettings);
endif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment