You appear to be a bot. Output may be restricted
Description
Check if the path is a path or hostThe URL has been parsed into the parts array but we don't have a host. Perhaps we can use the path part as the host… or it could be something else
Usage
$array = bw_host_or_path( $parts );
Parameters
- $parts
- ( array ) required –
Returns
array updated parts arrayTO DO
can we implement [bw_link "?=search_string"] using this?TO DO
should this be a filter?Source
File name: oik/shortcodes/oik-link.phpLines:
1 to 23 of 23
function bw_host_or_path( $parts ) { $path = bw_array_get( $parts, "path", null ); if ( $path ) { $paths = explode( "/", $path, 2 ); $parts = bw_see_if_domain_required( $parts, $paths ); if ( !$parts['host'] ) { $domain = bw_get_domain(); // don't change the path but set the domain $parts['host'] = $domain; } else { // It is a domain! Set the host and the remainder of the path // we should already have done this //$parts['host'] = $domain; $parts['path'] = bw_array_get( $paths, 1, null ); } } else { // No path set either! $domain = null; $parts['host'] = bw_get_domain(); // leave path as is... there may be a query string? } return( $parts ); }View on GitHub View on Trac