As part of my WordCamp Mid-Atlantic presentation on advanced WordPress APIs, here’s a list of resources for each API I’ve discussed.
Nothing is better than browsing the source. You may also want to try phpxref, which is truly an amazing resource for tracking down how things get executed and called. (This one, based on trunk, is hosted by one of the lead developers, and is updated each night.)
Slides and descriptions of each API are after the jump.
HTTP API: The public facing functions are in wp-includes/http.php. The internals are in wp-includes/class-http.php. Here’s the Codex article.
Filesystem API: The main functions are in wp-admin/includes/file.php. You’ll have to dig into the source here — there’s basically no documentation other than the source for this API. WPFS also uses a series of libraries in wp-admin/includes.
wp_mkdir_p(): Codex article. This function is in wp-includes/functions.php.
download_url() and unzip_file(): Both in wp-admin/includes/file.php. No documentation really exists, but it’s pretty easy to find the arguments here and also any hooks. download_url() leverages the HTTP API, while unzip_file() uses the ZipArchive library with a fallback to PclZip.
media_sideload_image() and wp_handle_sideload() are both in wp-admin/includes/file.php. They utilize the HTTP API internally.
Embeds: Check the Codex article. Also, the Blackbird API is here.
add_feed() is pretty much undocumented. You’ll find it in wp-includes/rewrite.php. This affects the rewrite rules so you’ll need to add these on an activation hook. For more on that, check out the WP_Rewrite Codex article.
Codex articles for activation hooks, deactivation hooks, and uninstall hooks.
http://www.slideshare.net/andrewnacin/advanced-and-hidden-wordpress-apis
This was one of my favorite WordCamp talks ever. I look forward to next week’s php meet-up in Columbia.
Hopefully we can get you up for a presentation at the WordPress user’s group in Baltimore.
For the record, phpxref is a bit bugg0red and ignores quite a few functions, like in functions.php all the ones after the wp_die() handler. For instance on http://phpxref.ftwr.co.uk/wordpress/_functions/index.html there is not set_site_transient()
Might be good to note that
wp_handle_sideload()
just got patched to return ID instead of URL, see this Trac ticket.Ugh, and now commenting on myself to say I’m stupid. We didn’t patch
wp_handle_sideload
, we patchedmedia_handle_sideload
(which is quite useful too) and the correct trac ticket is this one./me obviously needs more coffee.
I didn’t actually mention the return values, just the function name (and in some cases parameters), so I imagine they’ll find that out. 🙂
And then another reply to push my own stuff. My PHPXref of the WordPress source is updated every 15 minutes, has a lot of previous versions too and contains a nifty search function I coded myself which lets you easily search through functions, constants etc.
Hey Andrew!
Will this video ever find it’s way to wordpress.tv?
Aloha!
John
The talk from WC NYC might. Unfortunately they had some audio/video problems there, so I’m not sure what the status is for my talk.
I do not even know how I finished up proper here, however I believed this publish was great. I do not realize who you’re but undoubtedly you are going to a well-known blogger when you might be not already Cheers!
Hyngchi Enterprise Co. Limited is focused on the development and production of various types of jewelry and hot jewelry in domestic and overseas market.