public static function standard_dir($dir, $abspath_replace = null) { $dir = wp_normalize_path($dir); if (is_string($abspath_replace)) { if (!self::$abspath) { self::$abspath = wp_normalize_path(ABSPATH); } $dir = str_replace(self::$abspath, $abspath_replace, $dir); } return $dir; }
public static function standard_dir($dir, $abspath_replace = null) { $dir = str_replace('\\', '/', $dir); $dir = str_replace('//', '/', $dir); if (is_string($abspath_replace)) { if (!self::$abspath) { self::$abspath = self::standard_dir(ABSPATH); } $dir = str_replace(self::$abspath, $abspath_replace, $dir); } return $dir; }
public static function standard_dir($dir, $path_replace = null) { $dir = wp_normalize_path($dir); if (is_string($path_replace)) { if (!self::$abspath) { self::$abspath = wp_normalize_path(ABSPATH); self::$contentpath = wp_normalize_path(dirname(WP_CONTENT_DIR) . '/'); } $dir = str_replace(array(self::$abspath, self::$contentpath), $path_replace, $dir); } return $dir; }