The WP Page Tree plugin is a nice plugin. It shows a tree view of pages in your WP site… but it’s been broken since about version 3 or so.

I’m sure there are other tree view plugins that work well, but I liked that one. And it is actually an easy fix to get it working in WordPress versions 3+.

The issue was that the links generated in the tree view pointed to the old admin URLs for editing pages (page.php?action=edit&post=#). The new more generalized URLs for editing pages is (post.php?post=#&action=edit).

So, what you want to do is find line 404 in wppagetree.php (of version 2.8 of the plugin) and change page.php to post.php. That’s it. The whole block of code around there should look like:

if ($public) {
	// Create our own link to edit page for this ID
	$out .= "" . $pageTitle . "";
}
else {
	$out .= "" . $pageTitle . " #";
}

Or download this zip here which has version 2.8 of the plugin plus that one fix. I may upload it to the WP directory sometime, but then I’d have to maintain. Feel free to do it for me. ;)

Download: page-tree-fixed.zip

2 Responses to “Fix for WP Page Tree Plugin in WP 3+”

  1. Måns Jonasson says:

    Thank you Jason, I simply never had the time to check into this plugin since I also no longer use it myself.

    However, I just tested your extremely simple fix and it worked fine, so I’ve updated the plugin in the WP plugin repository now. Many thanks!

    /M;

    • admin says:

      Awesome! Just in time too. I believe Mullenweg said they were going to start hiding plugins over 2 years old in the repository.

      Thanks for the great plugin. I use it on almost every project.

* Required
* Required, Private