gmb_get_current_page_url

Get the current page URL.

Description

(string) gmb_get_current_page_url(); 

Returns (string)

$page_url Current page URL


Usage

  1. if ( !function_exists( 'gmb_get_current_page_url' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'maps-builder/vendor/wordimpress/maps-builder-core/includes/misc-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = gmb_get_current_page_url(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/vendor/wordimpress/maps-builder-core/includes/misc-functions.php  
  1. function gmb_get_current_page_url() { 
  2.  
  3. if ( is_front_page() ) : 
  4. $page_url = home_url(); 
  5. else : 
  6. $page_url = 'http'; 
  7.  
  8. if ( isset( $_SERVER["HTTPS"] ) && $_SERVER["HTTPS"] == "on" ) { 
  9. $page_url .= "s"; 
  10.  
  11. $page_url .= "://"; 
  12.  
  13. if ( isset( $_SERVER["SERVER_PORT"] ) && $_SERVER["SERVER_PORT"] != "80" ) { 
  14. $page_url .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"]; 
  15. } else { 
  16. $page_url .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]; 
  17. endif; 
  18.  
  19. return apply_filters( 'gmb_get_current_page_url', esc_url( $page_url ) );