CMS Tree Page View - Version 1.2.21

Version Description

  • Fixed and incompatibility issue with plugin Advanced Custom Fields.
Download this release

Release Info

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

Code changes from version 1.2.20 to 1.2.21

Files changed (3) hide show
  1. functions.php +33 -0
  2. index.php +2 -2
  3. readme.txt +6 -3
functions.php CHANGED
@@ -31,6 +31,28 @@ add_action("cms_tree_page_view_post_user_can_add_after", function($can_edit, $po
31
  }, 10, 2);
32
  */
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  /**
35
  * Use the ajax action-thingie to catch our form with new pages
36
  * Add pages and then redirect to...?
@@ -554,6 +576,10 @@ function cms_tpv_admin_menu() {
554
 
555
  foreach ($options["menu"] as $one_menu_post_type) {
556
 
 
 
 
 
557
  // post is a special one.
558
  if ($one_menu_post_type == "post") {
559
  $slug = "edit.php";
@@ -567,9 +593,11 @@ function cms_tpv_admin_menu() {
567
  // I think you can get a notice message here if you for example have enabled
568
  // the menu for a custom post type that you later on remove?
569
  if ( ! empty( $post_type_object ) ) {
 
570
  $menu_name = _x("Tree View", "name in menu", "cms-tree-page-view");
571
  $page_title = sprintf(_x('%1$s Tree View', "title on page with tree", "cms-tree-page-view"), $post_type_object->labels->name);
572
  add_submenu_page($slug, $page_title, $menu_name, $post_type_object->cap->edit_posts, "cms-tpv-page-$one_menu_post_type", "cms_tpv_pages_page");
 
573
  }
574
  }
575
 
@@ -607,10 +635,15 @@ function cms_tpv_options() {
607
  $post_types = get_post_types(array(
608
  "show_ui" => TRUE
609
  ), "objects");
 
610
 
611
  $arr_page_options = array();
612
  foreach ($post_types as $one_post_type) {
613
 
 
 
 
 
614
  $name = $one_post_type->name;
615
 
616
  if ($name === "post") {
31
  }, 10, 2);
32
  */
33
 
34
+ /**
35
+ * Check if a post type is ignored
36
+ */
37
+ function cms_tpv_post_type_is_ignored($post_type) {
38
+
39
+ $ignored_post_types = cms_tpv_get_ignored_post_types();
40
+
41
+ return in_array($post_type, $ignored_post_types);
42
+
43
+ }
44
+
45
+ /**
46
+ * Returns a list of ignored post types
47
+ * These are post types used by plugins etc.
48
+ */
49
+ function cms_tpv_get_ignored_post_types() {
50
+ return array(
51
+ // advanced custom fields
52
+ "acf"
53
+ );
54
+ }
55
+
56
  /**
57
  * Use the ajax action-thingie to catch our form with new pages
58
  * Add pages and then redirect to...?
576
 
577
  foreach ($options["menu"] as $one_menu_post_type) {
578
 
579
+ if ( cms_tpv_post_type_is_ignored($one_menu_post_type) ) {
580
+ continue;
581
+ }
582
+
583
  // post is a special one.
584
  if ($one_menu_post_type == "post") {
585
  $slug = "edit.php";
593
  // I think you can get a notice message here if you for example have enabled
594
  // the menu for a custom post type that you later on remove?
595
  if ( ! empty( $post_type_object ) ) {
596
+
597
  $menu_name = _x("Tree View", "name in menu", "cms-tree-page-view");
598
  $page_title = sprintf(_x('%1$s Tree View', "title on page with tree", "cms-tree-page-view"), $post_type_object->labels->name);
599
  add_submenu_page($slug, $page_title, $menu_name, $post_type_object->cap->edit_posts, "cms-tpv-page-$one_menu_post_type", "cms_tpv_pages_page");
600
+
601
  }
602
  }
603
 
635
  $post_types = get_post_types(array(
636
  "show_ui" => TRUE
637
  ), "objects");
638
+
639
 
640
  $arr_page_options = array();
641
  foreach ($post_types as $one_post_type) {
642
 
643
+ if ( cms_tpv_post_type_is_ignored($one_post_type->name) ) {
644
+ continue;
645
+ }
646
+
647
  $name = $one_post_type->name;
648
 
649
  if ($name === "post") {
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.20
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.20");
31
  define( "CMS_TPV_NAME", "CMS Tree Page View");
32
 
33
  require(dirname(__FILE__) . "/functions.php");
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.21
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.21");
31
  define( "CMS_TPV_NAME", "CMS Tree Page View");
32
 
33
  require(dirname(__FILE__) . "/functions.php");
readme.txt CHANGED
@@ -2,9 +2,9 @@
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.5.1
6
- Tested up to: 3.7
7
- Stable tag: 1.2.20
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
 
@@ -113,6 +113,9 @@ Now the tree with the pages will be visible both on the dashboard and in the men
113
 
114
  == Changelog ==
115
 
 
 
 
116
  = 1.2.20 =
117
  - Removed part of a comment beacuse it mentionened a file on another domain and therefore violated the repository guidelines. Also moved some sprites in CSS from loading external to loading internal.
118
 
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: 3.8.1
7
+ Stable tag: 1.2.21
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
 
113
 
114
  == Changelog ==
115
 
116
+ = 1.2.21 =
117
+ - Fixed and incompatibility issue with plugin Advanced Custom Fields.
118
+
119
  = 1.2.20 =
120
  - Removed part of a comment beacuse it mentionened a file on another domain and therefore violated the repository guidelines. Also moved some sprites in CSS from loading external to loading internal.
121