Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 41 of 258)

Personal opinions and how-to’s that I’ve written both here and as contributions to other blogs.

WordPress Widgets: Refactoring, Part 11

In the previous post, we walked through a lot of refactoring that separated concerns into their own classes.

Ultimately, this helps show how we can maintain a high level of cohesion while not only working with classes in WordPress but doing so alongside pre-existing APIs.

Because the last few posts on refactoring the code base have been so long, the current set of posts are focused on small, incremental changes and thus shorter, more focused posts.

As mentioned in the previous article:

But if you refresh the page, you may notice that the sanitization and serialization do not seem to work when retrieving the data. And that’s what we’re going to look into in the next post.

So that’s where we’re going to pick up in this article.

Continue reading

Adding Custom WordPress Plugin Links

If you’ve ever built a custom plugin for yourself or for someone else, then you’ve likely done something with the WordPress plugin links even if it’s just providing author information a URL to the homepage for the plugin.

And you know what I’m talking about: These are the links that appear below the name of the plugin.

WordPress Custom Plugin Links

According to the code reference, this information is:

The plugin’s metadata, including the version, author, author URI, and plugin URI.

Occasionally, though, you may find that you want to add or modify the links. That is, you can add your own custom links to appear in the list below.

Continue reading

Shorter Blog Posts, Revisited

A little over three years ago, I wrote a post about starting to write shorter blog posts. And in that particular posts, I made two comments that I think are still relevant but that I’ve gotten away from doing.

First, I wrote:

Because the truth is with the amount of information coming from other blogs, Twitter, and whatever other social networks and news sources you read, odds are that this site is one that can also be easily marked as read or thrown into Pocket oblivion never to be read again.

And I also wrote:

Secondly, it’ll aim to be more to the point than anything else. The idea being that you can load up the article, read through it quickly, save whatever information you’d like (or not), and then move on to whatever’s in your queue.

I don’t know if old habits die hard or if I’ve simply gotten away from it and back to writing longer form writing because that’s how I tend to write.

Shorter Blog Posts: Revisited

But I don’t want all of my posts to be that way.

Continue reading

WordPress Taxonomies: Terms, Parents, Children

Programmatically creating taxonomies seems to be a point that comes up now and again for those who are building solutions for others on WordPress.

Taxonomies themselves can even be a little confusing; however, I’ve found that the following usually helps to solidify the concept a bit:

Hierarchical taxonomies are analogous to categories; non-hierarchical taxonomies are analogous to tags.

But still, let’s say that you’re creating a solution for someone such that you need to import information as a post and apply a taxonomy to it. Further, perhaps you want to apply a parent taxonomy to the post, as well.

How can we do that?

Continue reading

WordPress Widgets: Refactoring, Part 10

As far as the WordPress Widget Boilerplate refactoring goes, we’re at a good place. A lot of work has been done such that introducing new classes, features, and functionality should be much easier.

And not only that: It should be easier to follow.

Thanks the work in the last post, we have a lot of work to build off of – namely, an basic administrative interface.

WordPress Widget: UI Improved

Finally, the last post said:

Over the next few articles, this is going to continue to evolve but, as you can see, we’re making sure that we have a single base class of functionality for talking with WordPress and a class specifically for rendering the administrative form.

And that’s where we’re going to pick up in this article. Specifically, we’re going to look at sanitizing and serializing the data as well as retrieving the data saved in the widget.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑