Software Engineering in Web Development, Backend Services, and More

Tag: WordPress (Page 189 of 220)

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

Should a WordPress Plugin Change Post Content?

Yesterday, I released Markdown Code For WordPress – an extremely simple plugin that makes it easy to replace Markdown backticks (`) with inline code comments. As mentioned in the post, it scratches an itch of my own that I’ve opted to share just in case anyone else shares the same, y’know, itch.

In the comments, Konstantin left a great question that I felt was worth discussing further:

Why not carry out the search and replace once before the post is saved and not every time it is displayed?

I left a response in the comments:

I didn’t want to do prior to saving the post just in case people use it, opt to disable the plugin, and then want to go with some other markdown editor or some other plugin. This keeps the original tokens in take so they can do a search and replace for it.

In short, I’ve had less than stellar experiences (read: back feedback) when it comes to mucking with data prior to saving it with the database especially when users want to abandon the plugin.

But I thought this was a great question that warranted a deeper discuss and wanted to bring it up here to get the rest of opinions from fellow developers.

Continue reading

Defining a Custom WordPress Menu Hook

When it comes to defining custom option pages, theme pages, menu pages, and submenu pages, the provided API makes this trivially easy; however, one of the less used aspects of these functions is the ability to define a custom WordPress menu hook.

For example, in a recent project I needed to do exactly that when adding a submenu to the WordPress Tools menu so I thought I’d share my process for doing exactly this.

Note that if you’re looking to add a submenu to a different WordPress menu, then there are a couple of options that are available. First and foremost, the most common option is to use add_submenu_page and then use tools.php as the parent slug as specified in the Codex.

But if you happen to be working with the Tools menu, then the add_management_page function is your best bet because it’s designed for exactly that.

So for this article, that’s what I’ll be using.

Continue reading

Three of My Favorite Coda Plugins For WordPress

As I’ve previously mentioned, I use Coda as my IDE for WordPress development. Honestly, it lacks a lot features that I miss about IDE’s like Visual Studio, but I’m a fan of the user interface and have found a number of Coda Plugins for WordPress that make it more a pleasant experience.

To that end, there are a number of plugins that I’ve added to Coda that enhance the overall development experience for WordPress and that I’ve found make it much easier to resolve some of the common problems that arise when writing WordPress-based code while trying to stay true to the coding standards.

Continue reading

How To Internationalize WordPress Plugins

During my time on working on the WordPress Plugin Boilerplate, I’ve had some really good discussions with Gary Jones about some of the practices and conventions used throughout the code.

Up until this point, I’ve traditionally included a plugin.po file with each of my plugins to make it easy for translators; however, Gary’s been kind enough to point out the a .pot file should actually be included.

From a discussion on GitHub:

If you read the Codex page you linked to, you’ll see that it explains that .pot is the correct extension to use for the original translation file, since it is the template from which .po and .mo files are generated.

I’m not above admitting when there’s something I’ve not been doing correctly – after all, most developers should constantly be improving right?

At least I hope that’s the case.

Luckily, there are tools that make generating this catalog trivially easy so I thought I’d provide the steps necessarily to internationalize WordPress plugins specifically how I did so for the latest release of the Boilerplate.

Continue reading

Making Remote Requests with wp_remote_get

When it comes to working with remote requests on the server side, there are usually two solutions that I end up seeing.

In fact, there are two solutions that I’ve typically ended up using:

Both of these functions generally work well; however, in our experience with Standard, we’ve had less than stellar experience especially when it comes to budget hosts.

This is where wp_remote_get comes into play. In short, wp_remote_get is a simple WordPress API function that’s used to retrieve data from a specified URL using the HTTP GET method.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑