Nested Pages - Version 1.2.1

Version Description

  • Bug fixes when using custom roles (Thanks to Luis Martins for troubleshooting help)
Download this release

Release Info

Developer kylephillips
Plugin Icon 128x128 Nested Pages
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.2.0 to 1.2.1

app/Controllers/AdminMenuController.php CHANGED
@@ -2,6 +2,7 @@
2
 
3
  use NestedPages\Controllers\PageListingController;
4
  use NestedPages\Helpers;
 
5
 
6
  /**
7
  * Admin Menus
@@ -14,6 +15,11 @@ class AdminMenuController {
14
  */
15
  private $post_type;
16
 
 
 
 
 
 
17
 
18
  public function __construct()
19
  {
@@ -26,6 +32,7 @@ class AdminMenuController {
26
  */
27
  public function adminMenu()
28
  {
 
29
  $this->pageMenu();
30
  }
31
 
2
 
3
  use NestedPages\Controllers\PageListingController;
4
  use NestedPages\Helpers;
5
+ use NestedPages\Entities\User\UserRepository;
6
 
7
  /**
8
  * Admin Menus
15
  */
16
  private $post_type;
17
 
18
+ /**
19
+ * User Repository
20
+ */
21
+ private $user;
22
+
23
 
24
  public function __construct()
25
  {
32
  */
33
  public function adminMenu()
34
  {
35
+ $this->user = new UserRepository;
36
  $this->pageMenu();
37
  }
38
 
app/Entities/User/UserRepository.php CHANGED
@@ -29,9 +29,13 @@ class UserRepository {
29
  $editable_roles = apply_filters('editable_roles', $all_roles);
30
  $roles = array();
31
  $exclude = array('Administrator', 'Contributor', 'Subscriber', 'Author');
32
- foreach($editable_roles as $editable_role){
33
  if ( !in_array($editable_role['name'], $exclude) ){
34
- array_push($roles, $editable_role['name']);
 
 
 
 
35
  }
36
  }
37
  return $roles;
@@ -51,7 +55,7 @@ class UserRepository {
51
 
52
  if ( current_user_can('edit_theme_options') ) return true;
53
  foreach($roles as $role){
54
- if ( in_array(ucfirst($role), $cansort) ) return true;
55
  }
56
  return false;
57
  }
29
  $editable_roles = apply_filters('editable_roles', $all_roles);
30
  $roles = array();
31
  $exclude = array('Administrator', 'Contributor', 'Subscriber', 'Author');
32
+ foreach($editable_roles as $key=>$editable_role){
33
  if ( !in_array($editable_role['name'], $exclude) ){
34
+ $role = array(
35
+ 'name' => $key,
36
+ 'label' => $editable_role['name']
37
+ );
38
+ array_push($roles, $role);
39
  }
40
  }
41
  return $roles;
55
 
56
  if ( current_user_can('edit_theme_options') ) return true;
57
  foreach($roles as $role){
58
+ if ( in_array($role, $cansort) ) return true;
59
  }
60
  return false;
61
  }
app/NestedPages.php CHANGED
@@ -12,7 +12,7 @@ class NestedPages {
12
  $np_env = 'live';
13
 
14
  global $np_version;
15
- $np_version = '1.2.0';
16
 
17
  $app = new NestedPages\Bootstrap;
18
  }
12
  $np_env = 'live';
13
 
14
  global $np_version;
15
+ $np_version = '1.2.1';
16
 
17
  $app = new NestedPages\Bootstrap;
18
  }
app/Views/settings-general.php CHANGED
@@ -30,12 +30,12 @@ settings_fields( 'nestedpages-general' );
30
  <td>
31
  <?php foreach ( $this->user_repo->allRoles() as $role ) : ?>
32
  <label>
33
- <input type="checkbox" name="nestedpages_allowsorting[]" value="<?php echo $role; ?>" <?php if ( in_array($role, $allowsorting) ) echo 'checked'; ?> >
34
- <?php echo $role; ?>
35
  </label>
36
- <input type="hidden" name="nestedpages_menusync" value="<?php echo get_option('nestedpages_menusync'); ?>">
37
  <br />
38
  <?php endforeach; ?>
39
- <p><em><?php _e('Admins always have sorting ability.', 'nestedpages'); ?></em></p>
 
40
  </td>
41
  </tr>
30
  <td>
31
  <?php foreach ( $this->user_repo->allRoles() as $role ) : ?>
32
  <label>
33
+ <input type="checkbox" name="nestedpages_allowsorting[]" value="<?php echo $role['name']; ?>" <?php if ( in_array($role['name'], $allowsorting) ) echo 'checked'; ?> >
34
+ <?php echo $role['label']; ?>
35
  </label>
 
36
  <br />
37
  <?php endforeach; ?>
38
+ <input type="hidden" name="nestedpages_menusync" value="<?php echo get_option('nestedpages_menusync'); ?>">
39
+ <p><em><?php _e('Admins always have sorting ability. Only roles with access to the pages screen will be able to view/edit the Nested Pages interface.', 'nestedpages'); ?></em></p>
40
  </td>
41
  </tr>
nestedpages.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Nested Pages
4
  Plugin URI: http://nestedpages.com
5
  Description: Provides an intuitive drag and drop interface for managing pages in the Wordpress admin, while maintaining quick edit functionality.
6
- Version: 1.2.0
7
  Author: Kyle Phillips
8
  Author URI: https://github.com/kylephillips
9
  Text Domain: nestedpages
3
  Plugin Name: Nested Pages
4
  Plugin URI: http://nestedpages.com
5
  Description: Provides an intuitive drag and drop interface for managing pages in the Wordpress admin, while maintaining quick edit functionality.
6
+ Version: 1.2.1
7
  Author: Kyle Phillips
8
  Author URI: https://github.com/kylephillips
9
  Text Domain: nestedpages
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://nestedpages.com/
4
  Tags: pages, admin, nested, tree view, page tree, sort, quick edit
5
  Requires at least: 3.8
6
  Tested up to: 4.1
7
- Stable tag: 1.1.9
8
 
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -78,6 +78,9 @@ If you have WordPress SEO by Yoast installed, your page score indicators are sho
78
 
79
  == Changelog ==
80
 
 
 
 
81
  = 1.2.0 =
82
  * PHP 5.3.2+ is now required to run Nested Pages. Will not run or install on older versions of PHP.
83
  * Visual nesting indication limit removed
@@ -137,7 +140,10 @@ If you have WordPress SEO by Yoast installed, your page score indicators are sho
137
 
138
  == Upgrade Notice ==
139
 
140
- = 1.2 =
 
 
 
141
  PHP 5.3.2 now required – Nested Pages will not install on older versions of PHP. If you are running less than 5.3.2, continue to use Nested Pages version 1.1.9.
142
 
143
  = 1.1.9 =
4
  Tags: pages, admin, nested, tree view, page tree, sort, quick edit
5
  Requires at least: 3.8
6
  Tested up to: 4.1
7
+ Stable tag: 1.2.0
8
 
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
78
 
79
  == Changelog ==
80
 
81
+ = 1.2.1 =
82
+ * Bug fixes when using custom roles (Thanks to Luis Martins for troubleshooting help)
83
+
84
  = 1.2.0 =
85
  * PHP 5.3.2+ is now required to run Nested Pages. Will not run or install on older versions of PHP.
86
  * Visual nesting indication limit removed
140
 
141
  == Upgrade Notice ==
142
 
143
+ = 1.2.1 =
144
+ Bug fix when using custom roles.
145
+
146
+ = 1.2.0 =
147
  PHP 5.3.2 now required – Nested Pages will not install on older versions of PHP. If you are running less than 5.3.2, continue to use Nested Pages version 1.1.9.
148
 
149
  = 1.1.9 =