Plugin Directory

Changeset 938019


Ignore:
Timestamp:
06/24/2014 07:32:20 PM (12 years ago)
Author:
pmtarantino
Message:

Independence of the uploads directory structure, using wp_upload_dir()

Location:
multisite-cloner/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • multisite-cloner/trunk/multisite-cloner.php

    r925411 r938019  
    55 * Plugin URI: https://wordpress.org/plugins/multisite-cloner
    66 * Description: When creating a new blog on WordPress Multisite, copies all the posts, settings and files, from a selected blog into the new one.
    7  * Version: 0.1.4
     7 * Version: 0.1.5
    88 * Author: Manuel Razzari & Patricio Tarantino
    99 * Author URI: http://tipit.net
     
    143143
    144144    function set_new_blog( $blog_id=false ) {
    145 
    146145        global $wpdb;
    147146
     
    193192        }
    194193
    195         $old_uploads = 'wp-content/uploads/sites/' . $id_default_blog;
    196         $new_uploads = 'wp-content/uploads/sites/' . $blog_id;
     194        $wp_uploads_dir = wp_upload_dir();
     195        $base_dir = $wp_uploads_dir['basedir'];
     196        $relative_base_dir = str_ireplace(get_home_path(), '', $base_dir);
     197
     198        $old_uploads = str_ireplace($blog_id, $id_default_blog, $relative_base_dir);;
     199        $new_uploads = $relative_base_dir;
    197200
    198201        // Replace URLs and paths in the DB
     
    207210
    208211        // Copy Files
    209         $new_uploads = '../../' . $new_uploads;
    210         $old_uploads = '../../' . $old_uploads;
     212        $old_uploads = str_ireplace($blog_id, $id_default_blog, $base_dir);;
     213        $new_uploads = $base_dir;;
    211214
    212215        cloner_recurse_copy($old_uploads, $new_uploads);
  • multisite-cloner/trunk/readme.txt

    r924028 r938019  
    6262== Changelog ==
    6363
     64= 0.1.5 =
     65* Independence of the uploads directory structure. ([Issue: Gives warning after creating subdomain site](http://wordpress.org/support/topic/gives-warning-after-creating-subdomain-site))
     66
    6467= 0.1.4 =
    6568* First public release.
     
    8184== Upgrade Notice ==
    8285
    83 = 0.1.4 =
    84 This is the first public release.
     86= 0.1.5 =
     87* Independence of the uploads directory structure.
Note: See TracChangeset for help on using the changeset viewer.