WordPressマイスター

WordPress Multisite Upload/URL Path Problem

Introduction

Regardless of WP version, these locations cannot be changed by site admins. Only the network admin can make changes on the site settings page.

But, ‘Upload path’ and ‘Upload Url path’ are ignored and/or changed automatically. Why and What’s happened?

Factors

  1. Bug #25819
    • ms_files_rewriting did not create when the WP updated to 3.5.
  2. ms_files_rewriting
    • If this value is “1”, values (on “site settings page”) are ignored.
  3. db_version and wp-includes/upgrade.php
    • if db_version < “21823”, ms_files_rewriting is set to “1” in wp-includes/upgrade.php
    • Even though I had been upgrading, db_version is not updated on the WP. It seems that some other conditions or patterns affects this problem.
  4. wp-includes/ms-default-contstants.php
    • If ms_files_rewriting is not set in table *_options or *_sitemeta it is set to “1”
    • ms_files_rewriting is used for setting some constants about uploading.
      e.g. UPLOADBLOGSDIR, UPLOADS, BLOGUPLOADDIR
  5. wp-includes/functions.php
    • ms_files_rewriting is used for setting Upload path and URL path.
  6. upload_path
    • Variable to specify where to upload
    • Deprecated since 3.5.

Conditions and Patterns

It seems that many conditions and patterns are there.
(Forgive me if I am wrong)


Possible choices

Q. Why is UPLOADBLOGSDIR not used?
A. Because it is ignored if ms_files_rewriting is 0.

Problems

Existing problem in Pattern #1
Expectable problem about Pattern #2
New Problem comes from Pattern #3

Conclusion

モバイルバージョンを終了