Software Engineering in WordPress, PHP, and Backend Development

Category: Tips (Page 10 of 10)

Various articles covering anything from how to programmatically achieve a certain task to useful ways that I’ve found to manage my time.

Configure Coda 2 To Connect MySQL

If you’ve recently installed or upgraded to Coda 2, are using MAMP to manage your development stack, and are looking to use the built-in MySQL frontend, here’s what you need to do in order to connect to MySQL in Coda 2.

Coda 2 and MAMP MySQL Socket

Setting up a connection between your project and its database is easy. It really only takes a single step though it assumes you know the username and password to your local database (which I can’t imagine why you wouldn’t know it :).

Continue reading

WordPress Ajax API Example

This plugin is no longer maintained; however, you can still view the source on GitHub.

As a developer, one of the challenges of working with WordPress as a platform is that finding information isn’t always easy. Sure, the Codex is a fantastic resource, but it lacks in a few areas.

On the other hand, it’s relatively easy to google for examples on how to do almost anything you’d like with WordPress, but these examples can often be of poor quality – just because something works doesn’t mean that it’s done correctly.

As I begin to shift my focus to talking more about WordPress development, I hope to be able to share a few thoughts on how to achieve certain tasks using the best practices with the WordPress API.

In recent weeks, I’ve been doing a fair amount of work using the WordPress Ajax API, so that seemed like a good place to start.

Continue reading

PHPUnit, WordPress, and MAMP

I’ve begun using PHPUnit, WordPress, and MAMP to introduce unit testing to my theme and plugin development. Obviously, this requires an installation of PHPUnit and the WordPress testing framework. Because I use MAMP for local development, I had to do some additional customization to get the frameworks setup.

Here are the steps necessary to install PHPUnit and the WordPress Tests on Mac OS X using MAMP:

Continue reading

Create a WordPress Upload Meta Box

This post was updated on March 22, 2013. Please review the code changes below.

WordPress makes it pretty easy to capture additional information with your posts through the use of custom meta boxes. Adding checkboxes, select options, textareas, radio buttons, and other input elements are easy.

But giving users the ability to upload files from a post screen requires a little more work.

If you’re not interested in tapping into the Media Uploader, then here’s how you can programmatically create a WordPress upload meta box.

Continue reading

Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑