Open
Description
I encountered a problem with my WP installation where I separated the WP core and the wp-content
folder into different locations within the filesystem, eg.:
- ABSPATH:
/var/www/myblog/public/wp/
- WP_CONTENT_DIR:
/var/www/myblog/public/wp-content/
In this case the code will produce a broken URL like http://foo.bar-content/plugins/...
I solved it by using the WP_PLUGIN_DIR instead of ABSPATH:
if ( 0 === strpos( $module_dir, $plugin_dir ) ) {
$rel_path = wp_normalize_path( str_replace( WP_PLUGIN_DIR, '', $module_dir));
$url = WP_PLUGIN_URL . $rel_path;
} else ...
Thanks and have a nice weekend!
Dennis
Metadata
Assignees
Labels
No labels
Activity