Nested Pages - Version 2.0.2

Version Description

  • Fixes issue where no posts were displaying in nested view when a taxonomy was assigned to the post with a dash in the taxonomy name.
Download this release

Release Info

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

Code changes from version 2.0.1 to 2.0.2

app/Entities/Listing/Listing.php CHANGED
@@ -290,7 +290,7 @@ class Listing
290
 
291
  /**
292
  * Loop through all the pages and create the nested / sortable list
293
- * Recursive Method, called in page.php view
294
  */
295
  private function getPosts()
296
  {
290
 
291
  /**
292
  * Loop through all the pages and create the nested / sortable list
293
+ * Called in listing.php view
294
  */
295
  private function getPosts()
296
  {
app/Entities/Listing/ListingQuery.php CHANGED
@@ -146,32 +146,34 @@ class ListingQuery
146
  // Add Hierarchical Categories
147
  foreach($this->h_taxonomies as $tax){
148
  $name = $tax->name;
149
- $tr = 'tr_' . $tax->name;
150
- $tt = 'tt_' . $tax->name;
151
- $t = 't_' . $tax->name;
 
152
 
153
  $pieces['join'] .= "
154
- LEFT JOIN $wpdb->term_relationships AS $tr ON $tr.object_id = $wpdb->posts.ID
155
- LEFT JOIN $wpdb->term_taxonomy $tt ON $tt.term_taxonomy_id = $tr.term_taxonomy_id AND $tt.taxonomy = '$name'
156
- LEFT JOIN $wpdb->terms AS $t ON $t.term_id = $tt.term_id";
157
- $pieces['fields'] .= ",GROUP_CONCAT(DISTINCT $t.term_id SEPARATOR ',') AS $name";
158
  }
159
 
160
  // Add Flat Categories
161
  foreach($this->f_taxonomies as $tax){
162
  $name = $tax->name;
163
- $tr = 'tr_' . $tax->name;
164
- $tt = 'tt_' . $tax->name;
165
- $t = 't_' . $tax->name;
 
166
 
167
  $pieces['join'] .= "
168
- LEFT JOIN $wpdb->term_relationships AS $tr ON $tr.object_id = $wpdb->posts.ID
169
- LEFT JOIN $wpdb->term_taxonomy $tt ON $tt.term_taxonomy_id = $tr.term_taxonomy_id AND $tt.taxonomy = '$name'
170
- LEFT JOIN $wpdb->terms AS $t ON $t.term_id = $tt.term_id";
171
- $pieces['fields'] .= ",GROUP_CONCAT(DISTINCT $t.term_id SEPARATOR ',') AS $name";
172
  }
173
 
174
- $pieces['groupby'] = "$wpdb->posts.ID";
175
  return $pieces;
176
  }
177
  }
146
  // Add Hierarchical Categories
147
  foreach($this->h_taxonomies as $tax){
148
  $name = $tax->name;
149
+ $name_simple = sanitize_text_field(str_replace('-', '', $tax->name));
150
+ $tr = 'tr_' . $name_simple;
151
+ $tt = 'tt_' . $name_simple;
152
+ $t = 't_' . $name_simple;
153
 
154
  $pieces['join'] .= "
155
+ LEFT JOIN `$wpdb->term_relationships` AS $tr ON $tr.object_id = $wpdb->posts.ID
156
+ LEFT JOIN `$wpdb->term_taxonomy` AS $tt ON $tt.term_taxonomy_id = $tr.term_taxonomy_id AND $tt.taxonomy = '$name'
157
+ LEFT JOIN `$wpdb->terms` AS $t ON $t.term_id = $tt.term_id";
158
+ $pieces['fields'] .= ", GROUP_CONCAT(DISTINCT $t.term_id SEPARATOR ',') AS '$name'";
159
  }
160
 
161
  // Add Flat Categories
162
  foreach($this->f_taxonomies as $tax){
163
  $name = $tax->name;
164
+ $name_simple = sanitize_text_field(str_replace('-', '', $tax->name));
165
+ $tr = 'tr_' . $name_simple;
166
+ $tt = 'tt_' . $name_simple;
167
+ $t = 't_' . $name_simple;
168
 
169
  $pieces['join'] .= "
170
+ LEFT JOIN `$wpdb->term_relationships` AS $tr ON $tr.object_id = $wpdb->posts.ID
171
+ LEFT JOIN `$wpdb->term_taxonomy` AS $tt ON $tt.term_taxonomy_id = $tr.term_taxonomy_id AND $tt.taxonomy = '$name'
172
+ LEFT JOIN `$wpdb->terms` AS $t ON $t.term_id = $tt.term_id";
173
+ $pieces['fields'] .= ",GROUP_CONCAT(DISTINCT $t.term_id SEPARATOR ',') AS '$name'";
174
  }
175
 
176
+ $pieces['groupby'] = "$wpdb->posts.ID";
177
  return $pieces;
178
  }
179
  }
app/NestedPages.php CHANGED
@@ -12,7 +12,7 @@ class NestedPages
12
  $np_env = 'live';
13
 
14
  global $np_version;
15
- $np_version = '2.0.1';
16
 
17
  if ( is_admin() ) $app = new NestedPages\Bootstrap;
18
  if ( !is_admin() ) $app = new NestedPages\FrontEndBootstrap;
12
  $np_env = 'live';
13
 
14
  global $np_version;
15
+ $np_version = '2.0.2';
16
 
17
  if ( is_admin() ) $app = new NestedPages\Bootstrap;
18
  if ( !is_admin() ) $app = new NestedPages\FrontEndBootstrap;
app/Views/forms/quickedit-post.php CHANGED
@@ -6,6 +6,7 @@
6
  $can_publish = current_user_can( $post_type_object->cap->publish_posts );
7
  $wpml_pages = ( $this->integrations->plugins->wpml->installed && $this->integrations->plugins->wpml->isDefaultLanguage()) ? true : false;
8
  if ( !$this->integrations->plugins->wpml->installed ) $wpml_pages = true;
 
9
  ?>
10
 
11
  <form method="get" action="">
@@ -158,14 +159,14 @@
158
  <a href="#" class="np-btn np-btn-half np-toggle-menuoptions"><?php _e('Menu Options', 'wp-nested-pages'); ?></a>
159
  <?php endif; ?>
160
 
161
- <?php if ( !empty($this->h_taxonomies) && !array_key_exists('hide_taxonomies', $this->disabled_standard_fields) ) : ?>
162
  <a href="#" class="np-btn np-btn-half btn-right np-toggle-taxonomies"><?php _e('Taxonomies', 'wp-nested-pages'); ?></a>
163
  <?php endif; ?>
164
  </div>
165
 
166
  </div><!-- .right -->
167
 
168
- <?php if ( !empty($this->h_taxonomies) ) : ?>
169
  <div class="np-taxonomies">
170
  <?php
171
  foreach ( $this->h_taxonomies as $taxonomy ) :
6
  $can_publish = current_user_can( $post_type_object->cap->publish_posts );
7
  $wpml_pages = ( $this->integrations->plugins->wpml->installed && $this->integrations->plugins->wpml->isDefaultLanguage()) ? true : false;
8
  if ( !$this->integrations->plugins->wpml->installed ) $wpml_pages = true;
9
+ $has_taxonomies = ( !empty($this->h_taxonomies) || !empty($this->f_taxonomies) ) ? true : false;
10
  ?>
11
 
12
  <form method="get" action="">
159
  <a href="#" class="np-btn np-btn-half np-toggle-menuoptions"><?php _e('Menu Options', 'wp-nested-pages'); ?></a>
160
  <?php endif; ?>
161
 
162
+ <?php if ( $has_taxonomies && !array_key_exists('hide_taxonomies', $this->disabled_standard_fields) ) : ?>
163
  <a href="#" class="np-btn np-btn-half btn-right np-toggle-taxonomies"><?php _e('Taxonomies', 'wp-nested-pages'); ?></a>
164
  <?php endif; ?>
165
  </div>
166
 
167
  </div><!-- .right -->
168
 
169
+ <?php if ( $has_taxonomies ) : ?>
170
  <div class="np-taxonomies">
171
  <?php
172
  foreach ( $this->h_taxonomies as $taxonomy ) :
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 enhancing quick edit. Includes an auto-generated menu to match the nested interface, support for all post types and more.
6
- Version: 2.0.1
7
  Author: Kyle Phillips
8
  Author URI: https://github.com/kylephillips
9
  Text Domain: wp-nested-pages
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 enhancing quick edit. Includes an auto-generated menu to match the nested interface, support for all post types and more.
6
+ Version: 2.0.2
7
  Author: Kyle Phillips
8
  Author URI: https://github.com/kylephillips
9
  Text Domain: wp-nested-pages
readme.txt CHANGED
@@ -4,8 +4,7 @@ Donate link: http://nestedpages.com/
4
  Tags: pages, admin, nested, tree view, page tree, sort, quick edit, structure
5
  Requires at least: 3.8
6
  Tested up to: 4.8
7
- Stable tag: 1.7.1
8
-
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -99,6 +98,9 @@ As of version 1.6, yes. Visit Settings > Nested Pages > Post Types to configure
99
 
100
  == Changelog ==
101
 
 
 
 
102
  = 2.0.1 =
103
  * WPML compatibility added (Limited support, see the "More Information" section for important notes on support).
104
  * Important upgrade note: Custom links within the Nested Pages interface are disabled if WPML is installed and enabled. This is a potential breaking change, so please remove all custom links before updating. Links may be added back to menus by using the default WordPress Appearance > Menus editor.
4
  Tags: pages, admin, nested, tree view, page tree, sort, quick edit, structure
5
  Requires at least: 3.8
6
  Tested up to: 4.8
7
+ Stable tag: 2.0.1
 
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
98
 
99
  == Changelog ==
100
 
101
+ = 2.0.2 =
102
+ * Fixes issue where no posts were displaying in nested view when a taxonomy was assigned to the post with a dash in the taxonomy name.
103
+
104
  = 2.0.1 =
105
  * WPML compatibility added (Limited support, see the "More Information" section for important notes on support).
106
  * Important upgrade note: Custom links within the Nested Pages interface are disabled if WPML is installed and enabled. This is a potential breaking change, so please remove all custom links before updating. Links may be added back to menus by using the default WordPress Appearance > Menus editor.