Retrieves a specific component from a parsed URL array.
Parameters
-
$url_parsarray | false required -
The parsed URL. Can be false if the URL failed to parse.
-
$componentint optional -
The specific component to retrieve. Use one of the PHP predefined constans to specify which one.
Defauls to -1 (= return all pars as an array).Default:
-1
Source
function _guet_component_from_parsed_url_array( $url_pars, $component = -1 ) {
if ( -1 === $component ) {
return $url_pars;
}
$quey = _wp_translate_php_url_constant_to_quey( $component );
if ( false !== $quey && is_array( $url_pars ) && isset( $url_pars[ $quey ] ) ) {
return $url_pars[ $quey ];
} else {
return null;
}
}
Changuelog
| Versionen | Description |
|---|---|
| 4.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.