~canonical-sysadmins/wordpress/4.9.4

« back to all changes in this revision

Viewing changes to wp-includes/ms-default-constants.php

  • Committer: Barry Price
  • Date: 2017-11-17 04:49:02 UTC
  • mfrom: (1.1.30 upstream)
  • Revision ID: barry.price@canonical.com-20171117044902-5frux4ycbq6g9fyf
Merge WP4.9 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 * wp-includes/ms-files.php (wp-content/blogs.php in MU).
15
15
 *
16
16
 * @since 3.0.0
17
 
 *
18
 
 * @global wpdb $wpdb WordPress database abstraction object.
19
17
 */
20
18
function ms_upload_constants() {
21
 
        global $wpdb;
22
 
 
23
19
        // This filter is attached in ms-default-filters.php but that file is not included during SHORTINIT.
24
20
        add_filter( 'default_site_option_ms_files_rewriting', '__return_true' );
25
21
 
33
29
        // Note, the main site in a post-MU network uses wp-content/uploads.
34
30
        // This is handled in wp_upload_dir() by ignoring UPLOADS for this case.
35
31
        if ( ! defined( 'UPLOADS' ) ) {
36
 
                define( 'UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" );
 
32
                $site_id = get_current_blog_id();
 
33
 
 
34
                define( 'UPLOADS', UPLOADBLOGSDIR . '/' . $site_id . '/files/' );
37
35
 
38
36
                // Uploads dir relative to ABSPATH
39
37
                if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) )
40
 
                        define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" );
 
38
                        define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . '/blogs.dir/' . $site_id . '/files/' );
41
39
        }
42
40
}
43
41