CMS Tree Page View - Version 1.2.33

Version Description

  • Fix conflicts with Formidable Forms. Fixes https://wordpress.org/support/topic/conflicts-with-formidable-forms. Thanks https://github.com/alexciarlillo for the pull request.
  • Maybe fix a URL path problem some had with HTTPS. Please let me know if you had problems over HTTPS and if this update solved it. Thanks!
  • Make donate blah-blah-nag-thingie perhaps and hopefully a little bit less annoying.
Download this release

Release Info

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

Code changes from version 1.2.32 to 1.2.33

Files changed (3) hide show
  1. functions.php +20 -5
  2. index.php +4 -3
  3. readme.txt +8 -1
functions.php CHANGED
@@ -447,6 +447,8 @@ function cms_tpv_promo_above_wrapper() {
447
  padding: 15px;
448
  background: #fff;
449
  box-shadow: 0 1px 1px 0 rgba(0,0,0,.15);
 
 
450
  }
451
  .cms_tpv_promo_above_wrapper p {
452
  margin: .25em 0;
@@ -454,6 +456,19 @@ function cms_tpv_promo_above_wrapper() {
454
  .cms_tpv_promo_above_wrapper-close {
455
  text-align: right;
456
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
457
  </style>
458
  <div class="cms_tpv_promo_above_wrapper">
459
 
@@ -1635,7 +1650,7 @@ function cms_tpv_add_page() {
1635
  */
1636
 
1637
  // update menu_order of all pages below our page
1638
- $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET menu_order = menu_order+2 WHERE post_parent = %d AND menu_order >= %d AND id <> %d ", $ref_post->post_parent, $ref_post->menu_order, $ref_post->ID ) );
1639
 
1640
  // create a new page and then goto it
1641
  $post_new = array();
@@ -1655,7 +1670,7 @@ function cms_tpv_add_page() {
1655
  */
1656
 
1657
  // update menu_order, so our new post is the only one with order 0
1658
- $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET menu_order = menu_order+1 WHERE post_parent = %d", $ref_post->ID) );
1659
 
1660
  $post_new = array();
1661
  $post_new["menu_order"] = 0;
@@ -1742,11 +1757,11 @@ function cms_tpv_move_page() {
1742
  // update menu_order of all pages with a menu order more than or equal ref_node_post and with the same parent as ref_node_post
1743
  // we do this so there will be room for our page if it's the first page
1744
  // so: no move of individial posts yet
1745
- $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET menu_order = menu_order+1 WHERE post_parent = %d", $post_ref_node->post_parent ) );
1746
 
1747
  // update menu order with +1 for all pages below ref_node, this should fix the problem with "unmovable" pages because of
1748
  // multiple pages with the same menu order (...which is not the fault of this plugin!)
1749
- $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET menu_order = menu_order+1 WHERE menu_order >= %d", $post_ref_node->menu_order+1) );
1750
 
1751
  $post_to_save = array(
1752
  "ID" => $post_node->ID,
@@ -1764,7 +1779,7 @@ function cms_tpv_move_page() {
1764
 
1765
  // update menu_order of all posts with the same parent ref_post_node and with a menu_order of the same as ref_post_node, but do not include ref_post_node
1766
  // +2 since multiple can have same menu order and we want our moved post to have a unique "spot"
1767
- $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET menu_order = menu_order+2 WHERE post_parent = %d AND menu_order >= %d AND id <> %d ", $post_ref_node->post_parent, $post_ref_node->menu_order, $post_ref_node->ID ) );
1768
 
1769
  // update menu_order of post_node to the same that ref_post_node_had+1
1770
  #$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET menu_order = %d, post_parent = %d WHERE ID = %d", $post_ref_node->menu_order+1, $post_ref_node->post_parent, $post_node->ID ) );
447
  padding: 15px;
448
  background: #fff;
449
  box-shadow: 0 1px 1px 0 rgba(0,0,0,.15);
450
+ float: right;
451
+ width: 250px;
452
  }
453
  .cms_tpv_promo_above_wrapper p {
454
  margin: .25em 0;
456
  .cms_tpv_promo_above_wrapper-close {
457
  text-align: right;
458
  }
459
+ .cms_tpv_promo_above_wrapper-close a {
460
+ color: #aaa;
461
+ text-decoration: none;
462
+ }
463
+ .cms_tpv_promo_above_wrapper-close a:hover {
464
+ text-decoration: underline;
465
+ }
466
+ /* hide on smallish screens */
467
+ @media screen and (max-width: 1000px) {
468
+ .cms_tpv_promo_above_wrapper {
469
+ display: none;
470
+ }
471
+ }
472
  </style>
473
  <div class="cms_tpv_promo_above_wrapper">
474
 
1650
  */
1651
 
1652
  // update menu_order of all pages below our page
1653
+ $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET menu_order = menu_order+2 WHERE post_type = %s AND post_parent = %d AND menu_order >= %d AND id <> %d ", $ref_post->post_type, $ref_post->post_parent, $ref_post->menu_order, $ref_post->ID ) );
1654
 
1655
  // create a new page and then goto it
1656
  $post_new = array();
1670
  */
1671
 
1672
  // update menu_order, so our new post is the only one with order 0
1673
+ $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET menu_order = menu_order+1 WHERE post_type = %s AND post_parent = %d", $ref_post->post_type, $ref_post->ID) );
1674
 
1675
  $post_new = array();
1676
  $post_new["menu_order"] = 0;
1757
  // update menu_order of all pages with a menu order more than or equal ref_node_post and with the same parent as ref_node_post
1758
  // we do this so there will be room for our page if it's the first page
1759
  // so: no move of individial posts yet
1760
+ $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET menu_order = menu_order+1 WHERE post_type = %s AND post_parent = %d", $post_ref_node->post_type, $post_ref_node->post_parent ) );
1761
 
1762
  // update menu order with +1 for all pages below ref_node, this should fix the problem with "unmovable" pages because of
1763
  // multiple pages with the same menu order (...which is not the fault of this plugin!)
1764
+ $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET menu_order = menu_order+1 WHERE post_type = %s AND menu_order >= %d", $post_ref_node->post_type, $post_ref_node->menu_order+1) );
1765
 
1766
  $post_to_save = array(
1767
  "ID" => $post_node->ID,
1779
 
1780
  // update menu_order of all posts with the same parent ref_post_node and with a menu_order of the same as ref_post_node, but do not include ref_post_node
1781
  // +2 since multiple can have same menu order and we want our moved post to have a unique "spot"
1782
+ $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET menu_order = menu_order+2 WHERE post_type = %s AND post_parent = %d AND menu_order >= %d AND id <> %d ", $post_ref_node->post_type, $post_ref_node->post_parent, $post_ref_node->menu_order, $post_ref_node->ID ) );
1783
 
1784
  // update menu_order of post_node to the same that ref_post_node_had+1
1785
  #$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET menu_order = %d, post_parent = %d WHERE ID = %d", $post_ref_node->menu_order+1, $post_ref_node->post_parent, $post_node->ID ) );
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: CMS Tree Page View
4
  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
- Version: 1.2.32
7
  Author: Pär Thernström
8
  Author URI: http://eskapism.se/
9
  License: GPL2
@@ -27,7 +27,7 @@ License: GPL2
27
 
28
  #require("functions.php");
29
 
30
- define( "CMS_TPV_VERSION", "1.2.32");
31
  define( "CMS_TPV_NAME", "CMS Tree Page View");
32
 
33
  require(dirname(__FILE__) . "/functions.php");
@@ -43,7 +43,8 @@ if ( isset( $network_plugin ) ) {
43
  if ( isset( $plugin ) ) {
44
  $aa = $plugin;
45
  }
46
- $plugin_dir_url = plugin_dir_url(basename($aa)) . 'cms-tree-page-view/';
 
47
 
48
  // There! Now we should have it.
49
  define( "CMS_TPV_URL", $plugin_dir_url);
3
  Plugin Name: CMS Tree Page View
4
  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
+ Version: 1.2.33
7
  Author: Pär Thernström
8
  Author URI: http://eskapism.se/
9
  License: GPL2
27
 
28
  #require("functions.php");
29
 
30
+ define( "CMS_TPV_VERSION", "1.2.33");
31
  define( "CMS_TPV_NAME", "CMS Tree Page View");
32
 
33
  require(dirname(__FILE__) . "/functions.php");
43
  if ( isset( $plugin ) ) {
44
  $aa = $plugin;
45
  }
46
+
47
+ $plugin_dir_url = trailingslashit( plugin_dir_url(basename($aa)) . basename(dirname($aa)) );
48
 
49
  // There! Now we should have it.
50
  define( "CMS_TPV_URL", $plugin_dir_url);
readme.txt CHANGED
@@ -2,9 +2,10 @@
2
  Contributors: eskapism, MarsApril
3
  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
  Requires at least: 3.8
6
  Tested up to: 4.2
7
- Stable tag: 1.2.32
8
 
9
  Adds a tree view of all pages & custom posts. Get a great overview + options to drag & drop to reorder & option to add multiple pages.
10
 
@@ -115,6 +116,12 @@ Now the tree with the pages will be visible both on the dashboard and in the men
115
 
116
  == Changelog ==
117
 
 
 
 
 
 
 
118
  = 1.2.32 =
119
 
120
  - Fix for possible XSS attack.
2
  Contributors: eskapism, MarsApril
3
  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.2.33
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
 
116
 
117
  == Changelog ==
118
 
119
+ = 1.2.33 =
120
+
121
+ - Fix conflicts with Formidable Forms. Fixes https://wordpress.org/support/topic/conflicts-with-formidable-forms. Thanks https://github.com/alexciarlillo for the pull request.
122
+ - Maybe fix a URL path problem some had with HTTPS. Please let me know if you had problems over HTTPS and if this update solved it. Thanks!
123
+ - Make donate blah-blah-nag-thingie perhaps and hopefully a little bit less annoying.
124
+
125
  = 1.2.32 =
126
 
127
  - Fix for possible XSS attack.