Tom McFarlin

Software Engineering in WordPress, PHP, and Backend Development

Page 247 of 428

One Way To Add Multiple Meta Boxes

One of the things that I like about open source the most is having discussions not only about how a person goes about doing something, but why they’ve chosen a particular route over an alternative.

Yes, reading books, articles, and other material from prolific, well-known, and respected programmers matters – I’m definitely not saying that we should throw that out – but there’s a lot that can be learned from peers who are sitting a couple of tweets, emails, or gists away from you.

Though I generally enjoy seeing how other people have approached their work and understanding the rationale behind it, I’m also pretty open about how I approach certain problems if for no other reason that the garner feedback from those of you who take the time to update gists, add comments, and so on.

Continue reading

Maintainable WordPress Meta Boxes

The comments on this post are closed. Please leave your feedback on each of the respective articles.

When it comes to enhancing the functionality of the CMS, WordPress meta boxes are one of the most flexible features that we can introduce to the post editor screen.

In short, they’re a way that we can open additional fields to one, some, or all of the existing post types as well as custom post types. They also make it possible to introduce a number of different type of elements – be it input fields, textareas, checkboxes, etc. – so that users can easily view, add, and/or modify data associated with a given post.

When it comes to writing meta boxes, especially those that are more elaborate than others, it can become a bit of chore to maintain the code over time. But it doesn’t have to be that way.

Continue reading

Become a Better Programmer. Just Like You.

Hang around any community long enough and you are going to see the good parts, the bad parts, and the weird parts . Similarly, I think that anyone who has been involved in any type of community for a significant amount of time will have plenty to complain about.

I’m not just talking about online communities either – this is just as applicable online as it is offline.

But, if you’re reading this, then you’re reading this online and odds are you’re active on Twitter or Facebook or some other form of social media where we all use the services as our own platform for sharing our opinions with the public where others can read, respond well, respond negatively, or ignore.

Whatever the case, I think that we’ve gotten far too comfortable sharing our criticisms in 140 characters or less without showing enough empathy or understanding or education for our peers and it’s to our own detriment that this is happening.
Continue reading

Using Codeship For Continuous Deployment of WordPress Projects

For anyone who has worked on commercial software for an agency or an organization – either large or small – is likely familiar with the idea of continuous deployment.

And it’s a great thing, right?

At several points throughout the day, all of the code that’s been committed to source control is run through testing, compiled (if needed), and then deployed after which an email is sent giving statistics of the build.

When working with WordPress, I think that tools like that are far less common. Instead, we test things locally, maybe we deploy things to staging, and then we hand off the project to the consumer or to the client.

For very small projects, I think a case can be made that that’s acceptable – I mean, you can go overkill on nearly anything – but if you’re going to be working on something that has a lot of moving parts and will be used by a lot of different people, doesn’t it stand to reason that having some type of deployment strategy something we should all be using?

Continue reading

Using jQuery To Set Select2 Selected Value

As much as I firmly believe in making sure that anything we build for WordPress especially as it relates to the dashboard should remain as consistent as possible.

As with anything, there are a few exceptions that I’ve made in the work specifically when it revolves around large select elements (multiselect or no).  That is, I’m a big fan of Select2 – I’ve written about it a couple of times and how I’ve used it in a couple of projects.

Because this is something that I regularly use, and because I know a number of WordPress developers (and general web developers, as well) also use this in their work – both in the dashboard functionality and in the public-facing functionality, as well – I wanted to share one way in which I’ve needed to programmatically set an option.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑