Skip to content

Instantly share code, notes, and snippets.

@jaibeee
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save jaibeee/2dba4d0c5440dbd85660 to your computer and use it in GitHub Desktop.

Select an option

Save jaibeee/2dba4d0c5440dbd85660 to your computer and use it in GitHub Desktop.

Revisions

  1. jaibeee revised this gist Jul 2, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    <?php

    /**
    * Updates cforms data to reflect the current host that it is on
    *
  2. jaibeee renamed this gist Jul 2, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. jaibeee created this gist Jul 2, 2014.
    26 changes: 26 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    /**
    * 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;
    }