• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress core a2z

WordPress core a2z

WordPress core only

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / _wp_translate_php_url_constant_to_key() – Translate a PHP_URL_* constant to the named array keys PHP uses.

You appear to be a bot. Output may be restricted

Description

Translate a PHP_URL_* constant to the named array keys PHP uses.

Usage

$string|false = _wp_translate_php_url_constant_to_key( $constant );

Parameters

$constant
( int ) required – PHP_URL_* constant.

Returns

string|false The named key or false.

Source

File name: wordpress/wp-includes/http.php
Lines:

1 to 18 of 18
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;
  }
}
 

 View on GitHub View on Trac

Published: 25th November 2019 | Last updated: 25th November 2019

Primary Sidebar

Information

Function name: _wp_translate_php_url_constant_to_key
Plugin ref: WordPress
Version: 5.6
Sourcefile: wp-includes/http.php
File ref: wp-includes/http.php
API type: private
Deprecated?: No
API Letters: _,P,T,U,W

Footer

WP-a2z
WordPress core a2z
WordPress core only
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  core.wp-a2z.org
© Copyright WP-a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites