Changes between Version 3 and Version 4 of Ticket #63376, comment 3
- Timestamp:
- 05/02/2025 07:17:12 AM (6 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #63376, comment 3
v3 v4 7 7 > The URL for the current site where the front end is accessible. 8 8 > https://developer.wordpress.org/reference/functions/home_url/ 9 10 11 Also, `get_self_link()` uses `home_url()`. It parses the URL, extracts the domain and port, sets the scheme for the URL, and appends `REQUEST_URI` from the server global variable. 12 13 {{{#!php 14 <?php 15 function get_self_link() { 16 $parsed = parse_url( home_url() ); 17 18 $domain = $parsed['host']; 19 if ( isset( $parsed['port'] ) ) { 20 $domain .= ':' . $parsed['port']; 21 } 22 23 return set_url_scheme( 'http://' . $domain . wp_unslash( $_SERVER['REQUEST_URI'] ) ); 24 } 25 }}} 26 27