Directory Structure
I have customized my (local) install (dev box). The current directory structure is:
./root
|- wp (WordPress Core root)
\
|- wp-config.php
|- wp-content (Content and Vendor root)
\
|- mu-plugins (...)
|- themes (...)
|- plugins (...)
|- uploads (Custom uploads dir)
|- vendor (Composer installed libraries)
|- index.php (loads ~/wp/index.php > require( dirname(__FILE__).'/wp/wp-blog-header.php' ); )
Config
In my wp-config.php
, I have the following setup:
define( 'WP_SITEURL', 'http://example.dev/wp' );
define( 'WP_HOME', WP_SITEURL );
define( 'WP_CONTENT_DIR', './../../wp-content' );
define( 'WP_CONTENT_URL', 'http://example.dev/wp-content' );
define( 'WP_PLUGIN_DIR', '../../wp-content/plugins' );
define( 'WP_PLUGIN_URL', WP_CONTENT_URL.'/plugins' );
define( 'WPMU_PLUGIN_DIR', '../../wp-content/mu-plugins' );
define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL.'/mu-plugins' );
It is a single site install and none of the following constants is defined (and therefore falls back to default): UPLOADBLOGSDIR
, UPLOADS
, BLOGUPLOADDIR
.
Filters
As @Sven (Hofmann) asked me in chat: The only plugin running on the *_url
filters is one mu-plugin that sets up the new themes directory:
add_filter( 'theme_root_uri', 'switch_theme_root_local' );
add_filter( 'theme_root', 'switch_theme_root_local' );
As you can see, there's nothing that can conflict with internal URls.
Problem
Step 1) When I go to the "Media Library" and click/open an attachment, the modal opens like normal and displays the media file (or in the problematic case: the image).
Step 2) Hit the "Edit Image" Link above and the following screen (modal replacement) appears. Note the broken image. I opened Chromes dev tools to show the el and attributes/path.
I have no idea how to debug this and/or where the broken links origin could be. I assume that this is burried somewhere in WordPress least documented parts: JavaScript templates for the media library.
defined
instead ofdefine
inwp-config.php
? I don't see this behavior on my skeleton installs.stream_preview_image()
,armed withexit()
andvar_dump()
;-) ps: it also looks like you got a different setup than mine, since I don't use relative paths like './../../wp-content', so I guess your config file is in some subdirectory.wp_die( -1 );
in thewp_ajax_imgedit_preview()
, either from!current_user_can('edit_post', $post_id)
or! stream_preview_image($post_id)
.