Tom McFarlin

Software Engineering in WordPress, PHP, and Backend Development

Page 329 of 428

How To Easily Filter Names in jQuery

If you're an advanced developer or just want the TL;DR version of this, skip to the code.

One of the more common UI design patterns is to render a table of data that includes rows that include people’s names, various information about them, and so on.

Usually, there are some type of control elements that allow you to filter the data by some type of criteria. Obviously, this is especially useful with large datasets where you don’t want to page through pages of data or scroll for a significantly long length of time.

Though there are a variety of ways to filter data – especially if you want to do so through the use of different values – one way that’s most common is to filter data by a person’s name.

If the data set is really large, this is often something that’s best left to process on the server side; however, if the data set is modest, it’s really easy to filter names in jQuery.

Continue reading

Programmatically Mark a Comment as Unapproved

In a recent project, I was working with someone who wanted to mark a comment as unapproved regardless of the value that was set in the WordPress settings.

Specifically, the person was using a plugin that allowed for certain attachments to the plugin. In order to make sure that the comment could be screened prior to allowing it to go public on the blog, they wanted to moderate it from the dashboard without needed to completely enable comment moderation across the board.

This is something that’s relatively easy to achieve programmatically.

Continue reading

Functions.php vs Plugin, Who Wins?

When it comes to introducing custom functionality into a WordPress project, the debate between functions.php vs. plugin usage is nothing new.

Generally speaking, I think of themes are presentation and plugins as functionality that transcend whatever theme or themes with which they’re installed.

But sometimes, this delineation isn’t so clear. For example, let’s say that you’re working on a theme that needs to introduce a custom meta box – or several – into the post editor screen.

Though this is presentation related in that it will impact what’s displayed to the users, it’s also a bit of custom functionality but it’s only relegated to this particular theme.

What then?

Continue reading

Tell Me: What Have You Done?

When it comes to building, launching, and maintaining your own projects – be it software, hardware, blogs, sites, songs, paintings, …, anything, etc. – one of the things that you have to be prepared for is the amount of criticism to which you’re opening yourself up.

Granted, you have to take the good with the bad, but the problem with the bad is that it’s so much easier to take to heart and/or focus on that the good, right?

But the irony in this is that not only do we subject ourselves to said criticism, but some also offer criticism to what others have done.

If you’re on the receiving end of said criticism, it’s easy to get defensive; if you’re on the giving end of the criticism, it’s easy to mask it as constructive when, in fact, it may not be at all.

So how do we deal with this kind of stuff on a day-to-day basis?

Continue reading

Flatdoc For Documentation with Markdown

Several times, I’ve mentioned that I’m a huge fan of markdown – I use it to write emails, I dig that that’s how GitHub handles README files, I use minor variations of it in my blogging, and I’ve got a favorite app for it.

Thanks to a heads up from one of my partners, I can now write documentation with markdown.

Here’s the thing: I’ve mentioned that I’m a huge advocate for code comments – I think it’s better to go a little overboard for the sake of clarity than not, especially in open source projects.

And sure, PHP DocBlocks and tools like PHPDocumentor make it relatively easy to generate documentation, but documentation like that is best suited for other developers. It’s not exactly end-user friendly, right?

In that case, you’re talking about writing a manual.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑