Dougal Campbell: WordPress Code Spelunking

Earlier today, I finished up a WordPress plugin that I’ve been working on for a client.  Without divulging too many details, I’ll say that it wasn’t a huge project, nor was it overly complicated, but it was interesting. One fun thing about working on projects for clients, is that it often gives you a chance to explore areas that you might not have looked too closely at on your own.

For example, some of the areas of WordPress (and PHP in general) that I researched and learned more about were:

I used a combination of the links above, other articles I found, plus some good old exploration in the WordPress core to learn more about these topics. Exploring the core code was most helpful in learning about WP_Http, wp_upload_bits(), and some extras for wp_insert_post() that aren’t documented on the Codex page.

Digging around in these corners of the code can be much like spelunking. You’re digging down into places never seen by most people, and often finding little gems that you suspected might exist, but you weren’t sure until you actually saw them. If you haven’t poked around in the core code lately, maybe you should. I usually prefer to use command-line tools like grep and a text editor. But the online WordPress phpdoc xref is a nice way to look at the code, too.

Related posts:

  1. Bug Chasing
  2. Suggestion: WordPress Option Namespacing
  3. WordPress 2.9 Features

Earlier today, I finished up a WordPress plugin that I’ve been working on for a client.  Without divulging too many details, I’ll say that it wasn’t a huge project, nor was it overly complicated, but it was interesting. One fun thing about working on projects for clients, is that it often gives you a chance to explore areas that you might not have looked too closely at on your own.

For example, some of the areas of WordPress (and PHP in general) that I researched and learned more about were:

I used a combination of the links above, other articles I found, plus some good old exploration in the WordPress core to learn more about these topics. Exploring the core code was most helpful in learning about WP_Http, wp_upload_bits(), and some extras for wp_insert_post() that aren’t documented on the Codex page.

Digging around in these corners of the code can be much like spelunking. You’re digging down into places never seen by most people, and often finding little gems that you suspected might exist, but you weren’t sure until you actually saw them. If you haven’t poked around in the core code lately, maybe you should. I usually prefer to use command-line tools like grep and a text editor. But the online WordPress phpdoc xref is a nice way to look at the code, too.

Related posts:

  1. Bug Chasing
  2. Suggestion: WordPress Option Namespacing
  3. WordPress 2.9 Features

Leave a Reply

Your email address will not be published. Required fields are marked *