CMS Tree Page View - Version 1.3.3

Version Description

(March 2016) =

  • Fix an error with WPML. Fixes https://wordpress.org/support/topic/all-pages-in-all-languages-showing-with-latest-wpml.
  • Fix an error with a filter. Fixes https://wordpress.org/support/topic/pages-not-displayed-after-updating-to-132-unknown-column-ids.
Download this release

Release Info

Developer eskapism
Plugin Icon wp plugin CMS Tree Page View
Version 1.3.3
Comparing to
See all releases

Code changes from version 1.3.2 to 1.3.3

Files changed (3) hide show
  1. functions.php +22 -7
  2. index.php +2 -2
  3. readme.txt +7 -2
functions.php CHANGED
@@ -288,7 +288,8 @@ function cms_tpv_admin_head() {
288
  <script type="text/javascript">
289
  /* <![CDATA[ */
290
  var CMS_TPV_URL = "<?php echo CMS_TPV_URL ?>";
291
- var CMS_TPV_AJAXURL = "?action=cms_tpv_get_childs&view=";
 
292
  var CMS_TPV_VIEW = "<?php echo $cms_tpv_view ?>";
293
  //var CMS_TPV_CAN_DND = "<?php echo current_user_can( CMS_TPV_MOVE_PERMISSION ) ? "dnd" : "" ?>";
294
  var CMS_TPV_CAN_DND = "dnd";
@@ -1302,11 +1303,26 @@ function cms_tpv_get_pages($args = null) {
1302
 
1303
  // filter out pages for wpml, by applying same filter as get_pages does
1304
  // only run if wpml is available or always?
1305
- // Note: get_pages filter uses orderby comma separated and with the key sort_column
1306
- $get_posts_args["sort_column"] = str_replace(" ", ", ", $get_posts_args["orderby"]);
1307
- $pages = apply_filters('get_pages', $pages, $get_posts_args);
 
 
 
1308
 
1309
- return $pages;
 
 
 
 
 
 
 
 
 
 
 
 
1310
 
1311
  }
1312
 
@@ -1348,8 +1364,7 @@ function cms_tpv_print_childs($pageID, $view = "all", $arrOpenChilds = null, $po
1348
  ?>[<?php
1349
  for ($i=0, $pagesCount = sizeof($arrPages); $i<$pagesCount; $i++) {
1350
 
1351
- $temp_page_id = $arrPages[$i];
1352
- $onePage = get_post($temp_page_id);
1353
 
1354
  $tmpPost = $post;
1355
  $post = $onePage;
288
  <script type="text/javascript">
289
  /* <![CDATA[ */
290
  var CMS_TPV_URL = "<?php echo CMS_TPV_URL ?>";
291
+ var CMS_TPV_AJAXURL = "action=cms_tpv_get_childs&view=";
292
+ CMS_TPV_AJAXURL = ((window.ajaxurl.indexOf("admin-ajax.php?") !== -1) ? "&" : "?") + CMS_TPV_AJAXURL;
293
  var CMS_TPV_VIEW = "<?php echo $cms_tpv_view ?>";
294
  //var CMS_TPV_CAN_DND = "<?php echo current_user_can( CMS_TPV_MOVE_PERMISSION ) ? "dnd" : "" ?>";
295
  var CMS_TPV_CAN_DND = "dnd";
1303
 
1304
  // filter out pages for wpml, by applying same filter as get_pages does
1305
  // only run if wpml is available or always?
1306
+ // Note: get_pages filter uses orderby comma separated and with the key sort_column
1307
+ $get_posts_args["sort_column"] = str_replace(" ", ", ", $get_posts_args["orderby"]);
1308
+
1309
+ // We only fetch ids above, but if we run the get_pages filter we need to send pages as object
1310
+
1311
+ $pages_as_objects = array();
1312
 
1313
+ foreach ($pages as $page_id) {
1314
+
1315
+ $one_page = new stdClass();
1316
+ $one_page->ID = $page_id;
1317
+ $pages_as_objects[] = $one_page;
1318
+
1319
+ }
1320
+
1321
+ // echo "<pre>";print_r($pages_as_objects);exit;
1322
+
1323
+ $pages_as_objects = apply_filters('get_pages', $pages_as_objects, $get_posts_args);
1324
+
1325
+ return $pages_as_objects;
1326
 
1327
  }
1328
 
1364
  ?>[<?php
1365
  for ($i=0, $pagesCount = sizeof($arrPages); $i<$pagesCount; $i++) {
1366
 
1367
+ $onePage = get_post( $arrPages[$i]->ID );
 
1368
 
1369
  $tmpPost = $post;
1370
  $post = $onePage;
index.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://eskapism.se/code-playground/cms-tree-page-view/
5
  Description: Adds a CMS-like tree view of all your pages, like the view often found in a page-focused CMS. Use the tree view to edit, view, add pages and search pages (very useful if you have many pages). And with drag and drop you can rearrange the order of your pages. Page management won't get any easier than this!
6
  Text Domain: cms-tree-page-view
7
  Domain Path: /languages/
8
- Version: 1.3.2
9
  Author: Pär Thernström
10
  Author URI: http://eskapism.se/
11
  License: GPL2
@@ -29,7 +29,7 @@ License: GPL2
29
 
30
  #require("functions.php");
31
 
32
- define( "CMS_TPV_VERSION", "1.3.2");
33
  define( "CMS_TPV_NAME", "CMS Tree Page View");
34
 
35
  require(dirname(__FILE__) . "/functions.php");
5
  Description: Adds a CMS-like tree view of all your pages, like the view often found in a page-focused CMS. Use the tree view to edit, view, add pages and search pages (very useful if you have many pages). And with drag and drop you can rearrange the order of your pages. Page management won't get any easier than this!
6
  Text Domain: cms-tree-page-view
7
  Domain Path: /languages/
8
+ Version: 1.3.3
9
  Author: Pär Thernström
10
  Author URI: http://eskapism.se/
11
  License: GPL2
29
 
30
  #require("functions.php");
31
 
32
+ define( "CMS_TPV_VERSION", "1.3.3");
33
  define( "CMS_TPV_NAME", "CMS Tree Page View");
34
 
35
  require(dirname(__FILE__) . "/functions.php");
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: http://eskapism.se/sida/donate/
4
  Tags: page, pages, posts, custom posts, tree, cms, dashboard, overview, drag-and-drop, rearrange, management, manage, admin
5
  Text Domain: cms-tree-page-view
6
  Requires at least: 3.8
7
- Tested up to: 4.2
8
- Stable tag: 1.3.2
9
 
10
  Adds a tree view of all pages & custom posts. Get a great overview + options to drag & drop to reorder & option to add multiple pages.
11
 
@@ -117,6 +117,11 @@ Now the tree with the pages will be visible both on the dashboard and in the men
117
 
118
  == Changelog ==
119
 
 
 
 
 
 
120
  = 1.3.2 (March 2016) =
121
 
122
  - Make the page tree use less memory. Should work ok with very large amount of pages now.
4
  Tags: page, pages, posts, custom posts, tree, cms, dashboard, overview, drag-and-drop, rearrange, management, manage, admin
5
  Text Domain: cms-tree-page-view
6
  Requires at least: 3.8
7
+ Tested up to: 4.4.2
8
+ Stable tag: 1.3.3
9
 
10
  Adds a tree view of all pages & custom posts. Get a great overview + options to drag & drop to reorder & option to add multiple pages.
11
 
117
 
118
  == Changelog ==
119
 
120
+ = 1.3.3 (March 2016) =
121
+
122
+ - Fix an error with WPML. Fixes https://wordpress.org/support/topic/all-pages-in-all-languages-showing-with-latest-wpml.
123
+ - Fix an error with a filter. Fixes https://wordpress.org/support/topic/pages-not-displayed-after-updating-to-132-unknown-column-ids.
124
+
125
  = 1.3.2 (March 2016) =
126
 
127
  - Make the page tree use less memory. Should work ok with very large amount of pages now.