From 2fead432a4ccc2993f1d2c36808bac77430d31b3 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Tue, 30 Apr 2019 17:02:37 -0600 Subject: [PATCH] Fix incorrect usage of ABSPATH See: https://github.com/CherryFramework/cherry-framework/issues/178 --- cherry-core.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cherry-core.php b/cherry-core.php index 284b73e..e4d3360 100755 --- a/cherry-core.php +++ b/cherry-core.php @@ -394,9 +394,7 @@ public static function base_url( $file_path = '', $module_path ) { $theme_dir = "$theme_root/$stylesheet"; if ( 0 === strpos( $module_dir, $plugin_dir ) ) { - $site_url = site_url(); - $abs_path = wp_normalize_path( ABSPATH ); - $url = str_replace( untrailingslashit( $abs_path ), $site_url, $module_dir ); + $url = str_replace( plugin_dir_path( $module_path ), plugin_dir_url( $module_path ), $module_dir ); } else if ( false !== strpos( $module_path, $theme_dir ) ) { $explode = explode( $theme_dir, $module_dir ); $url = get_stylesheet_directory_uri() . end( $explode );