Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 95 of 428)

Object-Oriented Programming in WordPress: Analysis, Part 2

In the first post in this series, I talked all about how I wanted to tackle about an introduction to object-oriented programming within the context of WordPress.

There are some great resources for object-oriented programming but they can use contrived examples, or they can move too quickly for those who are just looking to get started.

In an attempt to keep this from happening, I think talking about OOP in WordPress anchors us to a strong foundation and using practical examples will always be better than using generic examples that are difficult to translate to the domain in which we’re working.

For those who’ve yet to join or who haven’t caught up just yet, the first post hits on the following topics:

  • Object-Oriented Analysis,
  • Determining Must-Haves versus Nice-To-Haves,
  • And Why Is It Hard?

And that’s where this post is going to pick-up.

Continue reading

Object-Oriented Programming in WordPress: Analysis, Part 1

When I first set out to offer memberships on this site, I knew the first thing I wanted to tackle was an introduction to object-oriented programming.

It’s something that seems to be interesting to most people who are working in WordPress, but there’s a problem that either turns a lot of people away or generates poor results:

Object-oriented programming can get complicated fast. And this gets demotivating.

Here’s what I mean: Say you’re a WordPress developer who starts to research object-oriented programming. It starts off talking about classes and constructors and functions, and all seems well.

But then it quickly gets into:

  • private and protected methods,
  • inheritance,
  • polymorphism,
  • design patterns,
  • dependency injection,
  • repositories,
  • and so on.

It snowballs, doesn’t it? And that’s not at all how it has to be, but it’s hard to find a proper introduction save for a few resources that are out there.

With all of that said (and serving as a backdrop for where I’m headed), I wanted to set out to create a series of content for those who:

  • are genuinely interested in object-oriented programming,
  • aren’t sure where to start,
  • want to grow their skills,
  • want to start from ground-zero without escalating into more complicated material too quickly.

And that’s what I’m starting today and in the first major serious planned for members. With all of that said, let’s get started.

Specifically, let’st started talking about object-oriented programming, analysis, design, and why she should start there.

Continue reading

WordPress Templates For Beginners: Timber

Since talking about WordPress templating, I’ve covered some different engines that are available:

If you’re looking at Mustache, then you may be interested in Handlebars, and if you’re looking at Blade, then I highly recommend checking out Sage from the Roots team.

WordPress Templates: Sage

But for this final post, I’m going to continue with Timber which is what I introduced yesterday. I’m not so much about which is being used (as they all have their tradeoffs) as long as it’s consistent.

Continue reading

WordPress Templates for Beginners: What’s Templating, Anyway?

When talking about templating, regarding of if its WordPress templating, JavaScript templating, or templating in some other language, I think it’s helpful to use a concrete project or example to walk through how it works rather than talk about it in more esoteric terms.

If you’ve not been following along with this series and you’re just getting started with templating, I recommend reading the first two parts of the series:

  1. How It Is
  2. HTML Calling PHP

From there, we’re going to break down the concept into two parts:

  1. understanding what templating is,
  2. how templating can work within WordPress.

The challenge, of course, comes in that we have “WordPress templates” and then we’re talking about using a templating engine to change up WordPress templates, how they work, how data is injected into them, and so on.

But I’ll do my best to try to clarify each part.

Continue reading

WordPress Templates for Beginners: HTML Calling PHP

Yesterday, I sketched out how to conceptualize how many of us are likely used to working with WordPress templates.

Though the separation of concerns with CSS and JavaScript is solid, templates are problematic whenever there is a lot of PHP mixed with our markup.

To be clear, we can’t help but include template tags because that’s the nature of how WordPress and general PHP-based content management systems work.

The problem comes whenever we’re working with templates that contain code making more complex calls to various APIs. Though I demonstrated this using WP_Query (and will continue to do so), it’s not just that query.

Anyway, though, what are we supposed to do with this?

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑