[wp-hackers] Question about parameters to wp() function

Paul Menard codehooligans at codehooligans.com
Wed Nov 8 21:40:44 GMT 2006


This past summer I hacked into edit-pages.php and admin-functions.php  
(the page_rows() function), WP version 2.0.2 and 2.0.4. The site had  
more then 3000 total pages that were defined into 8 nested levels.  
The default loading of the edit pages window took something like 3-5  
minutes depending on server load.

So I made some code changes to display Tier I (post_parent=0) items  
first. If any of these items contains sub-items I would make the  
post_title display as a link and pass that page ID as the parent. So  
when the page reloads I pulled the parent page id from the _GET vars  
and display the tier items whose parent is the previous page posts.  
I'm sure you get the idea. I couldn't figure out a way to do this via  
a plugin so a hacking I went.

Finally my question:
Now I'm playing with the latest SVN trunk, WP version 2.1alpha3. I  
see some major changes in edit-pages.php and admin-functions.php. I  
just trying to see if my hack functionality will still work. In my  
original implementation I wrote some custom queries to pull in the  
values I needed. Now in the SVN version I'd like to use as much of  
the 'infrastructure' code that is provided. One function I'm trying  
to track down is wp(). This is called at the top of edit-pages.php to  
load the items for display. I've traced this into query.php to the  
function get_posts(). What I'm scratching my head about is how can I  
pass a parameter to filter the parent or child_of? Something like the  
get_pages() parameter 'child_of'.

Any thoughts?

Paul




More information about the wp-hackers mailing list