On this page
_wp_translate_php_url_constant_to_key( int $constant ): string|false
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Translate a PHP_URL_* constant to the named array keys PHP uses.
Parameters
$constantint Required-
PHP*URL** constant.
Return
string|false The named key or false.
Source
File: wp-includes/http.php. View all references
function _wp_translate_php_url_constant_to_key( $constant ) {
$translation = array(
PHP_URL_SCHEME => 'scheme',
PHP_URL_HOST => 'host',
PHP_URL_PORT => 'port',
PHP_URL_USER => 'user',
PHP_URL_PASS => 'pass',
PHP_URL_PATH => 'path',
PHP_URL_QUERY => 'query',
PHP_URL_FRAGMENT => 'fragment',
);
if ( isset( $translation[ $constant ] ) ) {
return $translation[ $constant ];
} else {
return false;
}
}
Related
Used By
| Used By | Description |
|---|---|
| _get_component_from_parsed_url_array() wp-includes/http.php | Retrieve a specific component from a parsed URL array. |
Changelog
| Version | Description |
|---|---|
| 4.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/_wp_translate_php_url_constant_to_key