Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 150 of 258)

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

WordPress and Theme-Specific Plugins

When it comes to working with WordPress themes and plugins, there’s a general rule of thumb that most experienced designers and developers follow:

Themes are for presentation, plugins are for functionality.

Sure, there’s a little bit of blurring of lines, but this is the goal for which we strive when working through our code. And yes, there’s a lot that can be said (and has been said) about themes that include a ton of features, options, bundled plugins, and so on, but that’s not where this is going.

WordPress Themes

Instead, I’ve been thinking about how this relates to general theme development, niche theme development, and using WordPress as a platform for application development.

Continue reading

Two Tips for Writing WordPress Plugins

Occasionally, I’m asked for two quick tips or suggestions that I have for those who are just getting started with writing WordPress plugins.

WordPress Plugins

The assumption is that they’ve done all of the necessary leg work to get to the point where they are comfortable writing code and working with WordPress, but they want to avoid some of the pitfalls that many (or most?) of us experience when we first get started on our own projects.

Continue reading

TinyMCE and WordPress: Adding User Input

In the previous post in this series, I showed how to add content to the post editor using a custom TinyMCE button. The problem with the approach, as we’ve covered thus far, is that the content that we’re adding to the editor is hard-coded.

We’re rarely going to want to be doing this, right? I mean, wouldn’t we rather grab input from the user and then add that to the editor?

My very own copy TinyMCE Editor. Show spectacular.

My very own copy TinyMCE Editor. So spectacular.

For some, this may be creating a shortcode based on some input, for others it may be grabbing input, making an Ajax call, and then putting the result of the request into the editor, or it may be something as simple as taking whatever input the user has provided in a prompt and then adding it to the editor.

Though the latter case is not likely something that is a realistic use case (after all, if they just wanted to put something into the editor, why not just, you know, enter it into the editor?), it’s something that will make rounding out this series a bit more complete because it will show how to connect displaying a prompt to the user, grabbing the input, then using the TinyMCE API to drop the input into the editor.

So that’s what we’ll do.

Continue reading

How To Save WordPress Submenu Page Options

If you’re using functions such as add_menu_page or add_submenu_page to create pages in the WordPress dashboard, it’s pretty easy to get something up and going, but what if you’re looking to actually save WordPress submenu page options?

Submenu Page Options

That is, let’s say you’re creating a page in the dashboard that’s tied to a new menu item – perhaps something that’s being added to the Tools menu – and you want to display some options among some other text or some other element or set of elements that you’re displaying.

It’s completely possible to use the Settings API to do exactly that, but it may also be a little heavy-handed for saving a couple a small set of options.

Luckily, WordPress has a hook that’s available that makes it pretty easy to save information like this that’s completely usable outside of the Settings API.
Continue reading

jQuery is Undefined

For those who have been in web development for sometime – especially those who have seen the rise (and stuck with) jQuery – then you’re likely all too familiar with some of the potential errors messages that you may see when working with the library.

But if you’re someone who is just starting out and perhaps you’re learning JavaScript and/or jQuery and you’re getting familiar with the developer tools that ship with your browser of choice, you’ve got your plate full of things that you’re having to debug.

jQuery

And sure, Google is your friend and being able to ask questions on sites such as Stack Overflow and other similar sites is nice (though the community may not always be such), but it’s not always fruitful.

In those cases, I think those of us who have gone down the same road that you’re traveling have some obligation to help educate what the problem is, why it’s happening, and how to resolve it.

And that’s what I’ve tried to to do in my most recent article for Envato.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑