lib/ImageHelper.php
static function theme_url_to_dir( $src ) 	{
		$site_root = trailingslashit(get_theme_root_uri()).get_stylesheet();
		$tmp = str_replace($site_root, '', $src);
		//$tmp = trailingslashit(get_theme_root()).get_stylesheet().$tmp;
		$tmp = get_stylesheet_directory().$tmp;
		if ( realpath($tmp) ) {
			return realpath($tmp);
		}
		return $tmp;
	}
static function theme_url_to_dir( $src ) 	{
		$site_root = trailingslashit(get_theme_root_uri()).get_stylesheet();
		$tmp = str_replace($site_root, '', $src);
		//$tmp = trailingslashit(get_theme_root()).get_stylesheet().$tmp;
		$tmp = get_stylesheet_directory().$tmp;
		if ( realpath($tmp) ) {
			return realpath($tmp);
		}
		return $tmp;
	}
static function theme_url_to_dir ( $ src ) { $ site_root = trailingslashit ( get_theme_root_uri ( ) ) . get_stylesheet ( ) ; $ tmp = str_replace ( $ site_root , '' , $ src ) ; //$tmp = trailingslashit(get_theme_root()).get_stylesheet().$tmp; $ tmp = get_stylesheet_directory ( ) . $ tmp ; if ( realpath ( $ tmp ) ) { return realpath ( $ tmp ) ; } return $ tmp ; }
Converts a URL located in a theme directory into the raw file path
@param string 	$src a URL (http://example.org/wp-content/themes/twentysixteen/images/home.jpg)
@return string full path to the file in question
Converts a URL located in a theme directory into the raw file path