lib/URLHelper.php
public static function remove_url_component( $haystack, $needle ) {
		$haystack = str_replace($needle, '', $haystack);
		$needle = self::swap_protocol($needle);
		return str_replace($needle, '', $haystack);
	}
public static function remove_url_component( $haystack, $needle ) {
		$haystack = str_replace($needle, '', $haystack);
		$needle = self::swap_protocol($needle);
		return str_replace($needle, '', $haystack);
	}
public static function remove_url_component ( $ haystack , $ needle ) { $ haystack = str_replace ( $ needle , '' , $ haystack ) ; $ needle = self :: swap_protocol ( $ needle ) ; return str_replace ( $ needle , '' , $ haystack ) ; }
Removes the subcomponent of a URL regardless of protocol
@since 1.3.3
@author jarednova
@param string $haystack ex: http://example.org/wp-content/uploads/dog.jpg
@param string $needle ex: http://example.org/wp-content
@return string
Removes the subcomponent of a URL regardless of protocol