Software Engineering in WordPress, PHP, and Backend Development

Category: Notes (Page 38 of 50)

Notes on programming-related problems that I’ve encountered while working on various projects.

Three Things I’ve Learned From Blogging

One of the cool things about managing a blog that talks significantly about code is the feedback that I get based on certain code snippets I share.

Specifically, I enjoy getting comments that ask why I’ve chosen to do things a certain way versus another. Some of these examples include:

  • Why have I opted to use functions rather than constants?
  • Why have I chosen to use a custom query over encapsulating some built in functions?
  • …and so on.

I think that for most people who manage a blog, they hope that part of what they write is contributing something positive and helpful to the Internet (this isn’t always the case, for sure).

Similarly, I think that people who engage in discussion via thoughtful comments are looking to improve on the original content.

At the risk of committing a generalization, this seems to be the case in most programming blogs. While thinking about this, it did raise a question:

Continue reading

Merry Christmas!

Merry Christmas 2012

Today, my family and I – and all of the in-laws on both sides – are celebrating Christmas, so we’re spending time exchanging gifts, hanging out, eating, and enjoying the time with each other.

Whatever you’re celebrating today – even if it’s nothing at all – I hope you guys are having an awesome time, as well.

I’m looking forward to bringing in 2013 with as much good stuff as possible and hope you are, as well. I’ll be back to the regular content tomorrow.

Merry Christmas and to all a good night (or good morning or whatever time it is where you are or when you read this :)).

The Inaugural Video Blog – Discussing WordPress: A Post Mortem

One of the best things about doing any type of experiment is that you’re not necessarily committed to following through on anything beyond seeing if the idea has any value.

Last week, I asked – in awkwardness and all – if there was any reason or interest in discussing WordPress development via a series of video blog posts. Overall, the response between the comments and via Twitter was nearly 50/50.

Continue reading

Quick Tip: Looping Through an Array with jQuery

When it comes to writing jQuery-based JavaScript, there are generally two camps of people:

  • Those who believe that you should intermingle jQuery with vanilla JavaScript for when you need it
  • Those who believe that if you’re importing jQuery, then you should use it as much as possible

Both camps have their own sets of arguments neither of which I’m looking to explore in this particular post; however, one of the features that’s all too common is having to loop through a vanilla array using JavaScript.

The two main ways that you can do about doing this are to use a standard for, while, or do loop or use jQuery’s iterator.

If you fall into the former camp, but are looking to use an iterator, here’s how you can begin looping through an array with jQuery.

Continue reading

Dynamically Creating a Custom Stylesheet For WordPress Plugins

For more technical users or to skip the the background explanation, skip directly to the code.

One of the challenges that comes with building WordPress plugins is supporting the conflicts that ensue with other poorly coded plugins and/or poorly coded themes.

It’s just the nature of the beast.

When it comes to addressing the way a plugin or widget looks on the frontend, I’ve often advised users to modify the plugin’s stylesheet in order to achieve the results they want.

Unfortunately, this is problematic for a number of reasons.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑