Tom McFarlin

Software Engineering in WordPress, PHP, and Backend Development

Page 207 of 428

Adding TinyMCE Dependencies in WordPress

If you’ve been following along with previous articles you know that over the last few days I’ve been working through a series on adding a TinyMCE button to WordPress.

Though this post isn’t exactly part of that series, it’s tangentially related and I thought it was something worth covering in case someone else stumbles across their problem in their work or if the code that shows up later in said series shows what’s up but doesn’t do a great job explaining it.

In short, when you have a JavaScript file that is a dependency on the core plugin, there’s another way of adding the dependency that does not include wp_enqueue_script.

Continue reading

Adding a TinyMCE Button to WordPress: The Plugin

If you’re interested in adding a TinyMCE button to WordPress, then this series of articles aims to do just that. In the first post of the series, I walked through some of the basic things that need to be done in order to get started with adding a custom button.

My very own copy TinyMCE Editor. Show spectacular.

My very own copy TinyMCE Editor. So spectacular.

I laid out the file organization, the basic plugin structure, some of the foundational JavaScript, and started working on the hooks that are necessary for adding a custom button.

As it stands right now, the functions responsible for adding a new button aren’t actually defined within the context of a class much less hooked into the plugin itself. So in this post, we’ll take a look at exactly how to do exactly that.

Continue reading

The Obligations of Learning a New Programming Language

One of the challenges that we – as programmers – are constantly faced with is learning a new programming language or whatever the latest and greatest technologies that are available (and using the term ‘greatest’ is just for the sake of the cliché phrase).

Then again, a lot of us get into this field for that exact reason, don’t we? I mean, we enjoy learning new technologies, applying them within the context of programming and problem solving, and then doing it again.

But after even just a few years in the business, it can get a little exhausting. This doesn’t mean it’s any less rewarding, but it does mean that when something else comes along – especially from the likes of larger players like Facebook, Twitter, or a similar company – other people are going to want to use them in their projects because the other company uses them and then we’re tasked with learning them.

For what it’s worth, I don’t consider it a bad thing, but it does contribute to the amount of time that goes into a project. This particular idea is something that’s better suited for a business-related post so I digress, for now.

But there’s another side to this:

A segment of the programming culture claims that we should be keeping our skills sharp by learning something new each year or so in order to make sure that we’re still relevant, to make sure that we’re still able to keep up with those coming up behind us, and generally able to keep up with the direction the web and/or software is headed.

And I don’t necessarily disagree with this, but if you’re in a position where you’re raising a family, or you’re in a position where you’re a little bit older and have obligations and responsibilities outside of your work such that you can’t spend as much time at a computer as you used to do (and I know that feel!), then this comes off as a very intimidating and frustrating demand on our time.

So why do we do it to ourselves?

Continue reading

Role Models in Software Development

As adults, some times I think it comes off as weird to talk about looking for “role models” as we usually look for people who are like mentors, advisors, influencers, etc. But for the purpose of this post, just assume that I’m talking about someone who influences us, or someone who’s further down the road than we are and from whom we can learn.

In so many other areas in our lives, especially when we’re younger, we often look for (or are told to look for) role models – you know, those people to whom we can look up and aspire to be like one day. Sometimes it’s in music, sometimes it’s in sports, sometimes it’s in writing, and in other times it’s in other areas.

Maybe this is a bit of a cynical stance, but sometimes I think it’s hard to find someone that’s worth looking up to for inspiration regardless of the arena.

But then I remember that when we look up to people, we often look up to people for what it is that they do versus who they are. For example, perhaps a person conducts their personal life in ways that you don’t agree, but they may conduct their professional life in ways that’s inspiring.

I think it’s important to divorce the two so that we know what it is to which we’re being inspired.

Continue reading

Adding a TinyMCE Button to WordPress

Over the years, it’s been really neat to see how the WordPress project has incorporated the TinyMCE editor into the software. That is, it’s one thing to include it into the core project, but it’s another thing to add features to it (and around it) that help improve the writing experience.

My very own copy TinyMCE Editor. Show spectacular.

My very own copy TinyMCE Editor. So spectacular.

But as developers, we’re often tasked with introducing another feature into the software. Sometimes this comes in the form of adding something like custom taxonomies or custom post types.

Other times, it comes in the form of having to introduce a new button to the TinyMCE editor. When you do that, you’re working simultaneously with the WordPress API and you’re working with the TinyMCE editor API.

Over the next few posts, I’m going to outline the process that I take whenever this is needed. Ultimately, this will aim to provide a foundation and set of steps that can be followed if you need to do the same thing, as well.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑