Timber\URLHelper::get_full_path PHP Method

get_full_path() public static method

public static get_full_path ( string $src ) : string
$src string
return string
    public static function get_full_path($src)
    {
        $root = ABSPATH;
        $old_root_path = $root . $src;
        $old_root_path = str_replace('//', '/', $old_root_path);
        return $old_root_path;
    }

Usage Example

示例#1
0
文件: Image.php 项目: mrgrain/timber
 /**
  * @internal
  * @param string $relative_path
  */
 protected function init_with_relative_path($relative_path)
 {
     $this->abs_url = home_url($relative_path);
     $file_path = URLHelper::get_full_path($relative_path);
     $this->file_loc = $file_path;
     $this->file = $file_path;
 }