Adminimize - Version 1.10.1

Version Description

(2016-02-29) = * Fix the Removing of Admin Color Scheme Select on the profile page. * Back-end options are also excluded on the settings page. * Add new settings area for options of the plugin self. * The support for multiple roles is now optional. * The support for bbPress is now active and optional.

Download this release

Release Info

Developer Bueltge
Plugin Icon wp plugin Adminimize
Version 1.10.1
Comparing to
See all releases

Code changes from version 1.10.0 to 1.10.1

CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
 
 
 
 
 
 
 
1
  ## 1.10.0 (2016-02-21)
2
  * Rewrite the Admin Bar settings, simplify the source and new hook to get and render the Admin Bar.
3
  * Change settings screen for custom post type.
1
+ ## 1.10.1 (2016-02-29)
2
+ * Fix the Removing of Admin Color Scheme Select on the profile page.
3
+ * Back-end options are also excluded on the settings page.
4
+ * Add new settings area for options of the plugin self.
5
+ * The support for multiple roles is now optional.
6
+ * The support for bbPress is now active and optional.
7
+
8
  ## 1.10.0 (2016-02-21)
9
  * Rewrite the Admin Bar settings, simplify the source and new hook to get and render the Admin Bar.
10
  * Change settings screen for custom post type.
adminimize.php CHANGED
@@ -7,13 +7,13 @@
7
  * Description: Visually compresses the administrative meta-boxes so that more admin page content can be initially seen. The plugin that lets you hide 'unnecessary' items from the WordPress administration menu, for all roles of your install. You can also hide post meta controls on the edit-area to simplify the interface. It is possible to simplify the admin in different for all roles.
8
  * Author: Frank Bültge
9
  * Author URI: http://bueltge.de/
10
- * Version: 1.10.0
11
  * License: GPLv3+
12
  *
13
  * @package WordPress
14
  * @author Frank Bültge <frank@bueltge.de>
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
16
- * @version 2016-02-19
17
  */
18
 
19
  /**
@@ -158,10 +158,12 @@ function _mw_adminimize_get_all_user_roles() {
158
  }
159
 
160
  // Exclude the new bbPress roles.
161
- $user_roles = array_diff(
162
- $user_roles,
163
- array( 'bbp_keymaster', 'bbp_moderator', 'bbp_participant', 'bbp_spectator', 'bbp_blocked' )
164
- );
 
 
165
 
166
  return $user_roles;
167
  }
@@ -186,16 +188,18 @@ function _mw_adminimize_get_all_user_roles_names() {
186
  }
187
 
188
  // exclude the new bbPress roles
189
- $user_roles_names = array_diff(
190
- $user_roles_names,
191
- array(
192
- esc_attr__( 'Keymaster', 'bbpress' ),
193
- esc_attr__( 'Moderator', 'bbpress' ),
194
- esc_attr__( 'Participant', 'bbpress' ),
195
- esc_attr__( 'Spectator', 'bbpress' ),
196
- esc_attr__( 'Blocked', 'bbpress' ),
197
- )
198
- );
 
 
199
 
200
  return $user_roles_names;
201
  }
@@ -310,9 +314,9 @@ function _mw_adminimize_admin_init() {
310
 
311
  $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
312
 
313
- // global options
314
  // exclude super admin
315
- if ( ! _mw_adminimize_exclude_super_admin() ) {
316
  $_mw_adminimize_footer = (int) _mw_adminimize_get_option_value( '_mw_adminimize_footer' );
317
  switch ( $_mw_adminimize_footer ) {
318
  case 1:
@@ -609,7 +613,7 @@ function _mw_adminimize_set_menu_option() {
609
  }
610
 
611
  // Support Multiple Roles for users.
612
- if ( 1 < count( $user->roles ) ) {
613
  $mw_adminimize_menu = _mw_adminimize_get_duplicate( $mw_adminimize_menu );
614
  $mw_adminimize_submenu = _mw_adminimize_get_duplicate( $mw_adminimize_submenu );
615
  }
@@ -690,12 +694,12 @@ function _mw_adminimize_set_global_option() {
690
  }
691
 
692
  // Support Multiple Roles for users.
693
- if ( 1 < count( $user->roles ) ) {
694
  $disabled_global_option = _mw_adminimize_get_duplicate( $disabled_global_option );
695
  }
696
  $global_options = implode( ', ', $disabled_global_option );
697
 
698
- if ( 0 !== strpos( $global_options, '#your-profile .form-table fieldset' ) ) {
699
  global $_wp_admin_css_colors;
700
  $_wp_admin_css_colors = 0;
701
  }
@@ -1232,13 +1236,26 @@ function _mw_adminimize_update() {
1232
  }
1233
  }
1234
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1235
  // Admin Bar Front end settings
1236
  $adminimizeoptions[ 'mw_adminimize_admin_bar_frontend_nodes' ] = _mw_adminimize_get_option_value(
1237
  'mw_adminimize_admin_bar_frontend_nodes'
1238
  );
1239
  // admin bar front end options
1240
  foreach ( $user_roles as $role ) {
1241
- // admin bar fron tend options
1242
  if ( isset( $_POST[ 'mw_adminimize_disabled_admin_bar_frontend_' . $role . '_items' ] ) ) {
1243
  $adminimizeoptions[ 'mw_adminimize_disabled_admin_bar_frontend_' . $role . '_items' ] = $_POST[ 'mw_adminimize_disabled_admin_bar_frontend_' . $role . '_items' ];
1244
  } else {
7
  * Description: Visually compresses the administrative meta-boxes so that more admin page content can be initially seen. The plugin that lets you hide 'unnecessary' items from the WordPress administration menu, for all roles of your install. You can also hide post meta controls on the edit-area to simplify the interface. It is possible to simplify the admin in different for all roles.
8
  * Author: Frank Bültge
9
  * Author URI: http://bueltge.de/
10
+ * Version: 1.10.1
11
  * License: GPLv3+
12
  *
13
  * @package WordPress
14
  * @author Frank Bültge <frank@bueltge.de>
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
16
+ * @version 2016-02-29
17
  */
18
 
19
  /**
158
  }
159
 
160
  // Exclude the new bbPress roles.
161
+ if ( ! _mw_adminimize_get_option_value( 'mw_adminimize_support_bbpress' ) ) {
162
+ $user_roles = array_diff(
163
+ $user_roles,
164
+ array( 'bbp_keymaster', 'bbp_moderator', 'bbp_participant', 'bbp_spectator', 'bbp_blocked' )
165
+ );
166
+ }
167
 
168
  return $user_roles;
169
  }
188
  }
189
 
190
  // exclude the new bbPress roles
191
+ if ( ! _mw_adminimize_get_option_value( 'mw_adminimize_support_bbpress' ) ) {
192
+ $user_roles_names = array_diff(
193
+ $user_roles_names,
194
+ array(
195
+ esc_attr__( 'Keymaster', 'bbpress' ),
196
+ esc_attr__( 'Moderator', 'bbpress' ),
197
+ esc_attr__( 'Participant', 'bbpress' ),
198
+ esc_attr__( 'Spectator', 'bbpress' ),
199
+ esc_attr__( 'Blocked', 'bbpress' ),
200
+ )
201
+ );
202
+ }
203
 
204
  return $user_roles_names;
205
  }
314
 
315
  $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
316
 
317
+ // Backend options
318
  // exclude super admin
319
+ if ( ! _mw_adminimize_exclude_super_admin() && ! _mw_adminimize_exclude_settings_page() ) {
320
  $_mw_adminimize_footer = (int) _mw_adminimize_get_option_value( '_mw_adminimize_footer' );
321
  switch ( $_mw_adminimize_footer ) {
322
  case 1:
613
  }
614
 
615
  // Support Multiple Roles for users.
616
+ if ( _mw_adminimize_get_option_value( 'mw_adminimize_multiple_roles' ) && 1 < count( $user->roles ) ) {
617
  $mw_adminimize_menu = _mw_adminimize_get_duplicate( $mw_adminimize_menu );
618
  $mw_adminimize_submenu = _mw_adminimize_get_duplicate( $mw_adminimize_submenu );
619
  }
694
  }
695
 
696
  // Support Multiple Roles for users.
697
+ if ( _mw_adminimize_get_option_value( 'mw_adminimize_multiple_roles' ) && 1 < count( $user->roles ) ) {
698
  $disabled_global_option = _mw_adminimize_get_duplicate( $disabled_global_option );
699
  }
700
  $global_options = implode( ', ', $disabled_global_option );
701
 
702
+ if ( 0 === strpos( $global_options, '#your-profile .form-table fieldset' ) ) {
703
  global $_wp_admin_css_colors;
704
  $_wp_admin_css_colors = 0;
705
  }
1236
  }
1237
  }
1238
 
1239
+ // Plugin Self Settings.
1240
+ if ( isset( $_POST[ 'mw_adminimize_multiple_roles' ] ) ) {
1241
+ $adminimizeoptions[ 'mw_adminimize_multiple_roles' ] = (int) $_POST[ 'mw_adminimize_multiple_roles' ];
1242
+ } else {
1243
+ $adminimizeoptions[ 'mw_adminimize_multiple_roles' ] = 0;
1244
+ }
1245
+
1246
+ if ( isset( $_POST[ 'mw_adminimize_support_bbpress' ] ) ) {
1247
+ $adminimizeoptions[ 'mw_adminimize_support_bbpress' ] = (int) $_POST[ 'mw_adminimize_support_bbpress' ];
1248
+ } else {
1249
+ $adminimizeoptions[ 'mw_adminimize_support_bbpress' ] = 0;
1250
+ }
1251
+
1252
  // Admin Bar Front end settings
1253
  $adminimizeoptions[ 'mw_adminimize_admin_bar_frontend_nodes' ] = _mw_adminimize_get_option_value(
1254
  'mw_adminimize_admin_bar_frontend_nodes'
1255
  );
1256
  // admin bar front end options
1257
  foreach ( $user_roles as $role ) {
1258
+ // admin bar front-end options
1259
  if ( isset( $_POST[ 'mw_adminimize_disabled_admin_bar_frontend_' . $role . '_items' ] ) ) {
1260
  $adminimizeoptions[ 'mw_adminimize_disabled_admin_bar_frontend_' . $role . '_items' ] = $_POST[ 'mw_adminimize_disabled_admin_bar_frontend_' . $role . '_items' ];
1261
  } else {
adminimize_page.php CHANGED
@@ -140,6 +140,7 @@ function _mw_adminimize_options() {
140
  <div class="wrap">
141
  <?php
142
  do_action( 'mw_adminimize_before_settings_form' );
 
143
  // Backend Options for all roles
144
  require_once 'inc-options/minimenu.php';
145
  ?>
@@ -147,6 +148,9 @@ function _mw_adminimize_options() {
147
  $_GET[ 'page' ]
148
  ); ?>">
149
  <?php
 
 
 
150
  // Admin Bar options
151
  require_once 'inc-options/admin_bar.php';
152
 
140
  <div class="wrap">
141
  <?php
142
  do_action( 'mw_adminimize_before_settings_form' );
143
+
144
  // Backend Options for all roles
145
  require_once 'inc-options/minimenu.php';
146
  ?>
148
  $_GET[ 'page' ]
149
  ); ?>">
150
  <?php
151
+ // Adminimize Settings for the plugin.
152
+ require_once 'inc-options/self_settings.php';
153
+
154
  // Admin Bar options
155
  require_once 'inc-options/admin_bar.php';
156
 
inc-options/minimenu.php CHANGED
@@ -32,6 +32,12 @@ if ( _mw_adminimize_is_active_on_multisite() ) {
32
  ); ?></a></td>
33
  </tr>
34
 
 
 
 
 
 
 
35
  <tr>
36
  <td class="row-title"><a href="#admin_bar_options"><?php esc_attr_e(
37
  'Admin Bar Back end Options', 'adminimize'
@@ -133,7 +139,7 @@ if ( _mw_adminimize_is_active_on_multisite() ) {
133
  </div>
134
 
135
  <div id="poststuff" class="ui-sortable meta-box-sortables">
136
- <div id="about" class="postbox ">
137
  <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div>
138
  <h3 class="hndle" id="about-sidebar"><?php esc_attr_e( 'About the plugin', 'adminimize' ) ?></h3>
139
 
32
  ); ?></a></td>
33
  </tr>
34
 
35
+ <tr>
36
+ <td class="row-title"><a href="#self-settings"><?php esc_attr_e(
37
+ 'Plugin Settings', 'adminimize'
38
+ ); ?></a></td>
39
+ </tr>
40
+
41
  <tr>
42
  <td class="row-title"><a href="#admin_bar_options"><?php esc_attr_e(
43
  'Admin Bar Back end Options', 'adminimize'
139
  </div>
140
 
141
  <div id="poststuff" class="ui-sortable meta-box-sortables">
142
+ <div id="about" class="postbox">
143
  <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div>
144
  <h3 class="hndle" id="about-sidebar"><?php esc_attr_e( 'About the plugin', 'adminimize' ) ?></h3>
145
 
inc-options/self_settings.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Adminimize
4
+ * @subpackage Admininmiz Options for the settings page
5
+ * @author Frank Bültge
6
+ * @since 2016-02-26
7
+ */
8
+ if ( ! function_exists( 'add_action' ) ) {
9
+ die( "Hi there! I'm just a part of plugin, not much I can do when called directly." );
10
+ }
11
+ ?>
12
+ <div id="poststuff" class="ui-sortable meta-box-sortables">
13
+ <div id="about" class="postbox">
14
+ <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div>
15
+ <h3 class="hndle" id="self-settings"><?php esc_attr_e( 'Plugin Settings', 'adminimize' ) ?></h3>
16
+
17
+ <div class="inside">
18
+
19
+ <table class="form-table">
20
+ <tr>
21
+ <td class="row-title"><label for="mw_adminimize_multiple_roles">
22
+ <?php esc_attr_e( 'Support Multiple Roles', 'adminimize' ); ?>
23
+ </label>
24
+ </td>
25
+ <td>
26
+ <input type="checkbox" value="1" id="mw_adminimize_multiple_roles"
27
+ name="mw_adminimize_multiple_roles" <?php checked(
28
+ _mw_adminimize_get_option_value( 'mw_adminimize_multiple_roles' ),
29
+ 1, TRUE ); ?>>
30
+ <?php esc_attr_e( 'If the user have more as one role and this function is active, Adminimize hide only items, there are active on each role of this user.', 'adminimize' ); ?>
31
+ </td>
32
+ </tr>
33
+ <tr>
34
+ <td class="row-title"><label for="mw_adminimize_support_bbpress">
35
+ <?php esc_attr_e( 'Support bbPress Roles', 'adminimize' ); ?>
36
+ </label>
37
+ </td>
38
+ <td>
39
+ <input type="checkbox" value="1" id="mw_adminimize_support_bbpress"
40
+ name="mw_adminimize_support_bbpress" <?php checked(
41
+ _mw_adminimize_get_option_value( 'mw_adminimize_support_bbpress' ),
42
+ 1,
43
+ TRUE ); ?>>
44
+ <?php esc_attr_e( 'See the bbPress roles also in each area to hide for this context.', 'adminimize' ); ?>
45
+ </td>
46
+ </tr>
47
+ </table>
48
+
49
+ <p id="submitbutton">
50
+ <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert" />
51
+ <input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php esc_attr_e(
52
+ 'Update Options', 'adminimize'
53
+ ); ?> &raquo;" /><input type="hidden" name="page_options" value="'dofollow_timeout'" />
54
+ </p>
55
+
56
+ <p>
57
+ <a class="alignright button" href="javascript:void(0);"
58
+ onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php esc_attr_e(
59
+ 'scroll to top', 'adminimize'
60
+ ); ?></a><br class="clear" />
61
+ </p>
62
+ </div>
63
+ </div>
64
+ </div>
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Bueltge
3
  Donate link: https://www.paypal.me/FrankBueltge
4
  Tags: color, scheme, theme, admin, dashboard, color scheme, plugin, interface, ui, metabox, hide, editor, minimal, menu, customization, interface, administration, lite, light, usability, lightweight, layout, zen
5
  Requires at least: 4.0
6
- Tested up to: 4.5-alpha
7
- Stable tag: 1.10.0
8
 
9
  Adminimize that lets you hide 'unnecessary' items from the WordPress backend
10
 
@@ -41,6 +41,13 @@ Use the installer via back-end of your install or ...
41
  1. Settings area in WP 4.5-alpha
42
 
43
  == Changelog ==
 
 
 
 
 
 
 
44
  = 1.10.0 (2016-02-21) =
45
  * Rewrite the Admin Bar settings, simplify the source and new hook to get and render the Admin Bar.
46
  * Change settings screen for custom post type.
3
  Donate link: https://www.paypal.me/FrankBueltge
4
  Tags: color, scheme, theme, admin, dashboard, color scheme, plugin, interface, ui, metabox, hide, editor, minimal, menu, customization, interface, administration, lite, light, usability, lightweight, layout, zen
5
  Requires at least: 4.0
6
+ Tested up to: 4.5-beta1
7
+ Stable tag: 1.10.1
8
 
9
  Adminimize that lets you hide 'unnecessary' items from the WordPress backend
10
 
41
  1. Settings area in WP 4.5-alpha
42
 
43
  == Changelog ==
44
+ = 1.10.1 (2016-02-29) =
45
+ * Fix the Removing of Admin Color Scheme Select on the profile page.
46
+ * Back-end options are also excluded on the settings page.
47
+ * Add new settings area for options of the plugin self.
48
+ * The support for multiple roles is now optional.
49
+ * The support for bbPress is now active and optional.
50
+
51
  = 1.10.0 (2016-02-21) =
52
  * Rewrite the Admin Bar settings, simplify the source and new hook to get and render the Admin Bar.
53
  * Change settings screen for custom post type.