Timber\URLHelper::is_local PHP Method

is_local() public static method

public static is_local ( string $url ) : boolean
$url string
return boolean
    public static function is_local($url)
    {
        if (strstr($url, self::get_host())) {
            return true;
        }
        return false;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * @internal
  * @param string $url
  */
 protected function init_with_url($url)
 {
     $this->abs_url = $url;
     if (URLHelper::is_local($url)) {
         $this->file = URLHelper::remove_double_slashes(ABSPATH . URLHelper::get_rel_url($url));
         $this->file_loc = URLHelper::remove_double_slashes(ABSPATH . URLHelper::get_rel_url($url));
     }
 }