From c8c40fb28fe23405905106d73967b0c71780c4e6 Mon Sep 17 00:00:00 2001 From: ultimatemember Date: Sun, 21 Dec 2014 18:34:47 +0200 Subject: [PATCH] Added option to enable/disable the plugin admin bar --- core/um-actions-wpadmin.php | 2 ++ um-config.php | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/core/um-actions-wpadmin.php b/core/um-actions-wpadmin.php index c42e1dfb..a2b3896f 100644 --- a/core/um-actions-wpadmin.php +++ b/core/um-actions-wpadmin.php @@ -33,6 +33,8 @@ global $wp_admin_bar; if( !is_super_admin() || !is_admin_bar_showing() || is_admin() ) return; + + if ( !um_get_option('wpadmin_um_bar') ) return; $args = array( 'id' => 'um_parent', diff --git a/um-config.php b/um-config.php index 75bc6bdc..fe237b5e 100644 --- a/um-config.php +++ b/um-config.php @@ -238,6 +238,16 @@ $this->sections[] = array( 'title' => __( 'Backend'), 'fields' => array( + array( + 'id' => 'wpadmin_um_bar', + 'type' => 'switch', + 'title' => __( 'Show Ultimate Member in admin bar when browsing the frontend?' ), + 'default' => 1, + 'desc' => 'Control whether to show or hide the Ultimate Member admin bar when you are browsing the frontend.', + 'on' => __('Yes','ultimatemember'), + 'off' => __('No','ultimatemember'), + ), + array( 'id' => 'panic_key', 'type' => 'text', @@ -253,8 +263,8 @@ $this->sections[] = array( 'title' => __( 'Allow Backend Login Screen for Guests' ), 'default' => 1, 'desc' => 'Control whether guests are able to access the WP-admin login screen or not', - 'on' => 'Yes', - 'off' => 'No', + 'on' => __('Yes','ultimatemember'), + 'off' => __('No','ultimatemember'), ), array( @@ -285,8 +295,8 @@ $this->sections[] = array( 'title' => __( 'Allow Backend Register Screen for Guests' ), 'default' => 1, 'desc' => 'Control whether guests are able to access the WP-admin register screen or not', - 'on' => 'Yes', - 'off' => 'No', + 'on' => __('Yes','ultimatemember'), + 'off' => __('No','ultimatemember'), ), array(