Tom McFarlin
Tom is a self-employed developer who loves writing, building, and sharing WordPress-based projects. He runs Pressware where he provides WordPress goods and services. You can follow him on Twitter.
Tutorials
  • Code
    The WordPress Coding Standards: The Ternary Operator and Yoda ConditionsThe wordpress coding standards
    5 shares
    At this point in the series, we've covered a lot of ground. Up to now, we've discussed the following topics: Naming Conventions and Function Arguments The Use of Single Quotes and Double Quotes Indentation, Space Usage, and Trailing Spaces Brace Style, Regular Expressions, and PHP Tags Lots of stuff, right? In this particular article, I thought we'd take it a bit easier before jumping into the final topic. As such, we're going to cover two really simple topics (that are often either ignored or overcomplicated). Specifically, we're going to talk about the ternary operator and we're going to talk about Yoda conditions.Read More…
  • Code
    The WordPress Coding Standards: Braces, Regular Expressions, and PHP TagsThe wordpress coding standards
    15 shares
    In this series, we've been taking a deep dive into the WordPress Coding Standards in order to get the word out about them, understand them, and begin to practically apply them in our day-to-day work. If you're just joining the series, so far we've covered the following topics: Naming Conventions and Function Arguments Single Quotes and Double Quotes Indentation, Space Usage, and Trailing Spaces In this article, we're going to continue building on top of the content in the previous article: Specifically, we're going to be taking a look at brace style, regular expressions, and nuances of working with PHP tags within the context of building WordPress themes, plugins, and applications.Read More…
  • Code
    The WordPress Coding Standards: Indentation, Space Usage, and Trailing SpacesThe wordpress coding standards
    8 shares
    The entire purpose of this series to help expose the WordPress Coding Standards, why they matter, and how to write quality WordPress code. In order to do this, we're taking an in-depth look at each section of the WordPress Coding Standards. So far, we've covered: Naming Conventions and Function Arguments Single Quotes and Double Quotes Today, we're going to be covering the importance of white space. Specifically, we're going to cover indentation, space usage, and trailing spaces. As easy as it sounds, these are several of the most ignored or misused aspects of the codings standards.Read More…
  • Code
    The WordPress Coding Standards: Single Quotes and Double QuotesThe wordpress coding standards
    11 shares
    In this series, we're taking a look at the WordPress PHP Coding Standards in order further understand how quality WordPress code should be written. Sure, all of this is documented in the WordPress Coding Standards and it's a site that every WordPress developer should have bookmarked and on hand when working on a theme, a plugin, or an application; however, if you're just getting into WordPress development, then it's important to understand the rationale as to why the conventions are the way they are. In this article, we're going to be taking a look at the use of single quotes and double quotes specifically when dealing with strings. This may be the shortest, most straightforward article in the series, but it should cover some important nuances as it relates to working with single quotes, double quotes, and strings in WordPress.Read More…
  • Code
    The WordPress Coding Standards: Naming Conventions and Function ArgumentsThe wordpress coding standards
    11 shares
    In this series, we're taking a deep dive into the WordPress Coding Standards - specifically, the PHP coding standards - in order to evangelize and understand how quality WordPress code should be written. Despite the fact that this is documented within the WordPress Developer Handbook, I think there's something to be said for understanding the rationale behind why some things are the way that they are. Remember: Our ultimate goal is to make sure that we're writing code that conforms to the coding standards so that we, along with other developers, are able to more easily read, understand, and maintain code for themes, plugins, and applications built on top of WordPress. In this post, we're going to be taking a look at how to handle naming conventions and function arguments.Read More…
  • Code
    The WordPress Coding Standards: An IntroductionThe wordpress coding standards
    18 shares
    When it comes to building WordPress-based products, we're somewhat cursed (or blessed, depending on how you see it), with a double-edged sword: Because WordPress is written in PHP, it's relatively easy to get WordPress - or the project itself - to do whatever it is we want to do all the while avoiding best practices. But this raises the question: What's the point of an API or formal coding standards if we're simply going to ignore them? We've written quite a bit about the WordPress APIs in previous articles, and we've touched on the WordPress Coding Standards, but we've never really taken a deep dive into the coding standards, understanding each aspect of them, and why they matter. So in this series, we're going to be doing just that.Read More…
  • Code
    Design Patterns in WordPress: We're Just Getting StartedDesign patterns in wordpress
    3 shares
    Throughout this series, we've been taking a look at a few design patterns and how they are applicable to software development - specifically WordPress development. The thing about design patterns is that there is a wide variety of them and it would be near impossible to do justice to each of the patterns in a series here on the blog. Nonetheless, hopefully taking a look at these three have helped kickstart your interest in using design patterns in your work.Read More…
  • Code
    Design Patterns in WordPress: The Simple Factory PatternDesign patterns in wordpress
    4 shares
    In this series, we're taking a look at design patterns and how we can leverage them to our advantage when building products on top of WordPress. The nice thing about design patterns is that they aren't explicitly limited to themes or plugins - they are handy in a variety of different scenarios. It's simply a matter of being able to identify which patterns are applicable to certain scenarios.Read More…
  • Code
    Design Patterns in WordPress: The Singleton PatternDesign patterns in wordpress
    20 shares
    Throughout this series, we're taking a look at the significance of design patterns and the roles that they play in WordPress development. In the first post in the series, we took a high-level survey and even reviewed the Observer Pattern to see how it's possible to register various functions or objects with certain events that occur within the lifecycle of an application. In this post, where's going to take a look at the Singleton Pattern.Read More…
  • Code
    Design Patterns in WordPress: An IntroductionDesign patterns in wordpress
    20 shares
    For those who have an extensive background in software engineering, design patterns should be familiar territory; however, there's an entire group of developers - especially in the web development community - who aren't necessarily familiar with design patterns (even though they've likely used them!). In this series, we're going to take a look at design patterns, specifically in the context of WordPress, how they're useful, and some practical examples that we can use in our themes and plugins.Read More…
  • Code
    Developing Plugins With a Distributed TeamDeveloping plugins with a distributed team1
    6 shares
    Recently, I had the opportunity to build a plugin with two other developers - Pippin Williamson and Andrew Norcross. We came up with the idea via Twitter, scoped it via email, and built it using GitHub using its tools all prior to releasing it.Read More…
  • Code
    A Beginner's Guide to Enqueuing jQueryA beginners guide to enqueuing jquery1
    6 shares
    One of the best things about WordPress is its vibrant economy. For many users, it's trivially easy to find themes to fit the design for which they're aiming, or to find plugins that provide functionality that they want to introduce into their site. But how many of you - as developers or designers - have a received that phone call or that email in which the customer claims that something is wrong with their site only to discover that the browser console displays something about an error having to do with JavaScript or jQuery?Read More…