[wp-hackers] Fast WordPress Function and Template Tag Lookups

Peter Westwood peter.westwood at ftwr.co.uk
Fri Mar 6 17:32:00 GMT 2009


On 6 Mar 2009, at 17:04, Ptah Dunbar wrote:

> What would be even better would be to hook into phpdocs or a phpxref  
> as the
> codex doesn't contain the most up-to-date docs for wp fucntions.


Theres a couple of simple ways of hooking into the phpdoc sites [1],[2]

Either use the api on WordPress.org which will give you a link to the  
phpdoc.wordpress.org site and is used in trunk for the documentation  
links from the theme editor.

e.g. http://api.wordpress.org/core/handbook/1.0/?function=get_pages

Or you can build something round the shell one-liner proof on concept  
code I came up with which I hope isn't driving the backend of the  
above api

curl "http://phpdoc.wordpress.org/trunk/li_WordPress.html" | grep  
"get_pages" | sed "s/^.*'\(.*\)'.*'.*'.*$/http:\/\/phpdoc.wordpress.org 
\/trunk\/\1/"

But if you do please cache the results as they aren't going to change  
very often!

I'm not sure if it's easy to build a similar lookup off the html  
generated by phpxref [3] but it may be.

[1] http://phpdoc.wordpress.org
[2] http://phpdoc.ftwr.co.uk
[3] http://phpxref.ftwr.co.uk

westi
-- 
Peter Westwood
http://blog.ftwr.co.uk | http://westi.wordpress.com
C53C F8FC 8796 8508 88D6 C950 54F4 5DCD A834 01C5



More information about the wp-hackers mailing list