From da5461376b2e14ba28e97bd52ab9dcd588e70ad5 Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Fri, 1 Jul 2016 10:39:22 +0800 Subject: [PATCH] Add new option for Network Permalink Structure --- core/um-permalinks.php | 4 +++- um-config.php | 31 ++++++++++++++++++++++++------- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/core/um-permalinks.php b/core/um-permalinks.php index 84290b08..8c010293 100644 --- a/core/um-permalinks.php +++ b/core/um-permalinks.php @@ -80,7 +80,9 @@ class UM_Permalinks { } }else { - if( um_core_is_local() ){ + $network_permalink_structure = um_get_option("network_permalink_structure"); + + if( $network_permalink_structure == "sub-directory" ){ $page_url = 'http'; diff --git a/um-config.php b/um-config.php index 8552b045..15b3fa39 100644 --- a/um-config.php +++ b/um-config.php @@ -1959,12 +1959,8 @@ $this->sections[] = array( *** @ ***/ -$this->sections[] = array( - - 'icon' => 'um-faicon-wrench', - 'title' => __('Advanced','ultimatemember'), - 'fields' => array( - +$arr_advanced_fields = array( + array( 'id' => 'import_export', 'type' => 'import_export', @@ -2101,6 +2097,27 @@ $this->sections[] = array( 'off' => __('Off','ultimatemember'), ), - ) +); + +if( is_multisite() ){ + $arr_advanced_fields[] = array( + 'id' => 'network_permalink_structure', + 'type' => 'select', + 'select2' => array( 'allowClear' => 0, 'minimumResultsForSearch' => -1 ), + 'title' => __( 'Network Permalink Structure','ultimatemember' ), + 'desc' => __( 'Change this If you are having conflicts with profile links or redirections in a multisite setup.','ultimatemember' ), + 'default' => 'sub-domain', + 'options' => array( + 'sub-domain' => __('Sub-Domain','ultimatemember'), + 'sub-directory' => __('Sub-Directory','ultimatemember'), + ) + ); +} + +$this->sections[] = array( + + 'icon' => 'um-faicon-wrench', + 'title' => __('Advanced','ultimatemember'), + 'fields' => $arr_advanced_fields );