I have a blog with a very complex page structure (like, 4 levels of hierarchy).
When creating new pages, it is very cumbersome to pick the parent page from the drop-down list, as it is constantly growing.
For that reason, I would like to add a button to the frontend admin bar that points to post-new.php
, but with a “parent page ID” parameter. Effectively, the button would allow you to navigate to the desired parent page on the front page, and then click a “add new page here” link there that takes you to the back-end with the parent page preselected.
However, it seems to be impossible to add parameters to post-new.php
and a related feature request has been closed in the WordPress trac.
Does anybody know a solution that does not require hacking the core? One idea I had was hooking up to a hook that gets triggered before a new item is created, pulling the parent page from a GET parameter there, and setting it in the item-to-be. If that is a viable way, I would be grateful for a simple pointer which hook to use.
You are right on the mark with GET, that would probably be easiest to make use of.
Try this: