Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 148 of 219)

Articles, tips, and resources for WordPress-based development.

Programmatically Deactivate WordPress Widgets

If you’re in the business of building themes for fun, for clients, or for purchase within a marketplace or your own store, then there’s a chance that there’s some type of functionality that’s unique to your theme that should be activated whenever the theme is activated.

In my experience, this is something that’s typically unique to niché WordPress themes because they tend to have specific features, customizations, and so on that are relevant to their theme.

Case in point: Let’s say that you’re working on a niché theme that has a number of widgetized areas, but also has very specific widgets for said areas. That is, upon theme activation, you want to make sure that each widgetized area is clear so not to bust up the layout.

In other words, you need to programmatically deactivate WordPress widgets whenever the theme is activated so that the layout of the theme looks as it should when the user activates it.

Continue reading

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

Documenting The WordPress Plugin Boilerplate

A little over a month ago, I released the latest version of the WordPress Plugin Boilerplate. The response has been great – more than I was expecting, really but that’s a good thing – and, generally speaking, it’s been overall positive.

The WordPress Plugin Boilerplate Homepage

The WordPress Plugin Boilerplate Homepage

Over the last month or so, it’s become clear that more time and resources will be needed to focus on the Boilerplate and to continue to refine its codebase, its functionality, its documentation, and so on. The bottom line is that I want to make sure that I get the right – or as close to right – as possible during the first try.

To that end, I need some input from others (read: you).

Continue reading

Display an Error if a File Is Too Large for WordPress

If you’re working on a project for WordPress that’s going to allow users to upload files – be it a video, an image, a CSV, or any other type of data – then you’re likely going to be faced with a situation where you’re going to need to determine if a file is too large for WordPress.

Yeah, it's a little too large.

Yeah, it’s a little too large.

What’s considered “too large” can be related to any number of factors:

  • The size of the file is larger than you want to accept (or the file system accepts)
  • A PHP timeout occurs when uploading a file because of its size
  • The file system doesn’t have enough space
  • …and so on.

Whatever the case may be, there are two things that you’re going to need to be able to do:

  1. Determine if the file fits within constraint of the system (whatever the constraint is)
  2. Display an error message to the user before the upload occurs

It doesn’t exactly provide for a stellar experience when trying to upload something only to have it rejected by the server without a proper error message, does it?

Continue reading

WordPress’ Related Posts and Featured Images (Yes, Again)

About two months ago, I wrote about the usability of WordPress featured images.

Though nothing has changed in the last few months, there has been one use case that I find leans in the direction of supporting featured images despite their potential improvement for usability. Specifically, it deals with using the Related Posts feature of Jetpack.

Related Posts without Featured Images

Related Posts without Featured Images

For those who are new to WordPress or this specific feature of Jetpack, Related Posts makes it really easy to add links to similar posts at the end of each post:

The Related Posts feature scans all of your posts, analyzes them, and lets you show contextual posts your visitors might be interested in reading after they’re done with whatever post they’re on.

Nice, right?

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑