path2url() results in wrong path
-
Running Nimble Portfolio plugin v2.1.0 with site_url that is different from home_url.
path2url() results in the most wrong path ever – doing string_replace on a string, based on the wrong assumption is quite bad.
Please use the below code:
function path2url($path) { if (!defined('ABSPATH')) { return false; } return plugin_dir_url($path) . basename($path); //return trim(site_url(), '/\\') . "/" . str_replace("\\", "/", trim(substr_replace($path, '', 0, strlen(ABSPATH)), '/')); }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘path2url() results in wrong path’ is closed to new replies.