Tom McFarlin

Software Engineering in WordPress, PHP, and Backend Development

Page 154 of 428

Displaying Custom Messages in WordPress, Part 1

When working with the Settings API (or any other API that handles options, serialization, validation, and page redirections), dealing with custom messages in WordPress isn’t something that we typically have to worry about it.

Custom Messages in WordPress, Part 1

The API takes care of all of that for us, and if we need to use other pieces of information, like the query string, we’re able to take advantage of API functions like get_query_var to check for the presence of a given value without much thought for how it was added in the first place.

But what about when you’re working on your administration page, and you need to display custom messages in WordPress after a redirect?

Continue reading

A Critical Update to Scheduled Post Shortcut?

Based on active installs, ratings, and the like, Scheduled Post Shortcut isn’t what you’d call a popular plugin. Far from it, actually. But I’m okay with that.

Remember that when Eric and I first started releasing these plugins, the goal was not only to create small plugins that solved problems we were experiencing as bloggers, but also to do so in a way that made it as simple as possible for others to use in their day-to-day writing.

And since there are problems that he and I still experience, we continue to update the plugin.

Continue reading

Using PHP CodeSniffer with Pressmatic and Atom

Regarding my development environment, this is the first year that I’ve made drastic changes to my toolset in several years (once I find things I really like, I tend to stick with them).

Atom Packages for WordPress

Case in point, in the last few months alone:

And with these changes come some other necessary configuration changes. Specifically, I still use PHP CodeSniffer but, out of necessity, its setup and configuration have changed.

Continue reading

Using Xdebug with Pressmatic

A few weeks ago, Pressmatic made a grand entrance into the WordPress development space with its unique positioning as a WordPress-specific development environment.

Pressmatic with WordPress Trunk

Specifically, it describes itself as such:

Pressmatic is a robust local WordPress manager. You won’t be disappointed with the ease of use, performance, and features.

I’ve been using it ever since (and talked about it in a couple of previous posts). Generally speaking, I’ve been really happy with one.

One of the features that it claims as a major benefit is:

One-click integration of Xdebug + PHPStorm.

And that’s great if you are using PHPStorm; however, those of you who’ve read this blog for any length of time within the past year or so know that I’m a fan of Codebug (which is essentially a front-end for Xdebug) and that I’ve made the switch to Atom.

So if you’re working with anything other than PHPStorm and you’re looking make use of Xdebug with Pressmatic, here’s a step-by-step guide for how to do so.

Continue reading

Saving Empty Radio Button Values in WordPress

One of the projects I’ve been working on recently presents the user with a comprehensive set of options. As usual, the options take the form of a variety of different elements:

  • input text fields,
  • radio buttons,
  • select elements,
  • and more.

In most cases, you should be familiar with initializing default values for all of these element types. Radio buttons may be the exception. And if they are, then you’ve no doubt run into a PHP notice when saving empty radio button values.

And having PHP notices is no good, right?

Regardless of if you’re using the WordPress Settings API or some custom serialization code, these notices can still show up. If you use Query Monitor, then you’ve likely seen this show up in your menu. Similarly, if you use the Console (or another application) to monitor your PHP logs, you’ve probably seen the error as well.

OS X Console

One place in which this can be tricky to deal with is when you’re working with radio buttons without an initial value.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑