mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Add option for port forwarding in URL
This commit is contained in:
@@ -33,8 +33,10 @@ class UM_Permalinks {
|
||||
function get_current_url( $no_query_params = false ) {
|
||||
global $post;
|
||||
|
||||
$server_name_method = ( um_get_option('current_url_method') ) ? um_get_option('current_url_method') : 'SERVER_NAME';
|
||||
|
||||
$um_get_option = get_option('um_options');
|
||||
$server_name_method = ( $um_get_option['current_url_method'] ) ? $um_get_option['current_url_method'] : 'SERVER_NAME';
|
||||
$um_port_forwarding_url = ( $um_get_option['um_port_forwarding_url'] ) ? $um_get_option['um_port_forwarding_url']: '';
|
||||
|
||||
if ( !isset( $_SERVER['SERVER_NAME'] ) )
|
||||
return '';
|
||||
|
||||
@@ -52,16 +54,19 @@ class UM_Permalinks {
|
||||
}
|
||||
$page_url .= "://";
|
||||
|
||||
if ( isset( $_SERVER["SERVER_PORT"] ) && $_SERVER["SERVER_PORT"] != "80" && $_SERVER["SERVER_PORT"] != "443" ) {
|
||||
if ( $um_port_forwarding_url == 1 && isset( $_SERVER["SERVER_PORT"] ) ) {
|
||||
$page_url .= $_SERVER[ $server_name_method ].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
|
||||
|
||||
} else {
|
||||
$page_url .= $_SERVER[ $server_name_method ].$_SERVER["REQUEST_URI"];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( $no_query_params == true ) {
|
||||
$page_url = strtok($page_url, '?');
|
||||
}
|
||||
|
||||
|
||||
return apply_filters( 'um_get_current_page_url', $page_url );
|
||||
}
|
||||
|
||||
@@ -1876,6 +1876,16 @@ $this->sections[] = array(
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'um_port_forwarding_url',
|
||||
'type' => 'switch',
|
||||
'title' => __( 'Allow Port forwarding in URL','ultimatemember' ),
|
||||
'default' => 0,
|
||||
'desc' => __('Turn on If you want to include port number in URLs','ultimatemember'),
|
||||
'on' => __('On','ultimatemember'),
|
||||
'off' => __('Off','ultimatemember'),
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'advanced_denied_roles',
|
||||
'type' => 'text',
|
||||
|
||||
Reference in New Issue
Block a user