Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 383 of 428)

Giveaway: Free HTML5 Stickers

Comments are now closed on this post. I'll be emailing the first five commenters privately.

I’ve got a set of five large HTML5 stickers. They’d look awesome on the back of your laptop, the back of your car, or maybe on the face of your ugliest friend:

Giveaway: HTML5 Stickers

Here’s the deal:

Continue reading

Understanding WP_Query

I’ve done my fair share of work with WP_Query this week – it’s definitely been an exercise in education, but when an employee of Automattic comments and offers advice, it’s worth listening

But I wanted to keep the conversation going for the benefit of other developers.

As such, I wanted to reblog this talk by lead WordPress developer and Audrey Capital technologist Andrew Nacin in which he discusses the various topics surrounding WordPress queries, hooks, and so on in order guide others in understanding WP_Query.

Continue reading

How To Unit Test WordPress Settings API Validators

For those who are experienced with the Settings API, you may wish to skip down to the core problem.

How To Unit Test WordPress Settings API Validators

I’m currently building a web application where WordPress is serving as the core framework. I’ve discussed this before and Matt covered this in State of the Word 2012 as something that will become more common as WordPress grows in popularity.

So WordPress doesn’t necessarily have an MVC or MVVM or whatever design pattern, but it offers its own method for how data models, business logic, and other necessary components should be created.

I’m using the Settings API to create a model that represents a user in the application. Essentially, it will wrap the core WordPress user model, but I have to introduce some additional attributes and ultimately create relationships with other models that WordPress doesn’t natively support.

Anyway, I’m writing unit tests for everything that’s going into the application and I hit an interesting point when it came to unit testing the validation functions.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑