Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 54 of 258)

Personal opinions and how-to’s that I’ve written both here and as contributions to other blogs.

An Easy Way to Cast a PHP Standard Class to a Specific Type

If you work with object-oriented PHP in WordPress and you’re building out various models that fit your web applications, the odds are that you’re going to deal with retrieving serialized versions of those models at some point during a program’s execution.

Here’s the thing, though: Sometimes, that unserialized data come back as standard PHP classes. This means that if you inspect the type (through various debugging tools), you’re going to see they are the type of stdClass.

Cast a PHP a Standard Class to a Specific Type: Type Juggling

If you’ve been properly building your models those, your code is going to have functions that the stdClass does not, and you’re going to want to call on them.

Further, you can’t simply cast them from one type to another like you can with native types (such as strings, integers, and so on). In situations like that, you need to be able to cast a PHP standard class to a specific type.

And here’s a function that will help you do just that.

Continue reading

Tools For WordPress Projects: Some of What I Use Daily

Developers are often interested in the way other developers configure their setups. And I get it.

That is, I assume it’s based on the idea of seeing what tools others are using to determine if you’re missing out on something, if you could improve what you’re currently doing, or if you’re comfortable with what you have.

Whatever the case, I’ll occasionally get emails, tweets, or ICQ messages (wait, what?) that ask what suite of tools for WordPress projects I typically use for each of my projects.

So I thought I’d share a rundown of each application that I typically use and a short description as to how I use each one of them in my day-to-day work.

Continue reading

Triggering Angular Events with jQuery (As Weird As That May Sound)

One of the things that I enjoy about working with WordPress is the ability to bring in third-party libraries and tools with which to work.

This doesn’t mean they don’t come without their learning curve (they all do, right?), but it’s often fun – albeit frustrating, at times – to incorporate and then manipulate what you’re doing.

As far as third-party technologies go, I’ve seen people bring things in such as the Laravel Illuminate package with WordPress.

Triggering Angular Events with jQuery: Illuminate

And I know, especially in recent years, many have brought in components such as React and Vue.

Triggering Angular Events with jQuery: React

In one such instance, I’ve been doing some work with Angular. And if you’re used to ES6, vanilla JavaScript, or using jQuery, then triggering Angular events with jQuery can seem a bit weird at first.

Triggering Angular Events with jQuery: Angular

But once you understand the markup and how Angular handles its events, it’s not so bad.

Continue reading

Now Offering Two New Benefits for Site Members (With More to Come)

One of the things on the backlog of things that I’ve been working to do is to put together a list of benefits for members. Here’s the thing, though: The WordPress economy is vast, so what one person can do or from what they may benefit is not going to be the same as what another person can do or benefits.

What’s to be done about that?

Regarding providing solutions for the site, the current state of memberships on this site is easy to define:

  • offer object-oriented introductions and practices,
  • practical tips for how to achieve specific tasks,
  • how to apply all the above in your day-to-day work.

But that’s not all I want it to be. In addition to all of that, I also want to provide members with access to software, courses, and more than help them get better at what it is you do on a day-to-day basis.

And that’s what today’s post is about: Finally announcing a couple of benefits for site members.

Continue reading

I Don’t Know if Social Media is Good

Though I try to keep the topics on this site strictly limited to development of all things WordPress (and related technologies) that doesn’t mean I don’t sometimes venture out into more personal things (such as taking time off of social media).

Usually, I find taking time off of these services helps me to focus on some different things, reflect on whether or not I like them, what they offer us as a whole, or simply take a break from the things social media brings with it.

But one of the things I’ve found myself thinking about over the last month – and not necessarily on purpose, but it’s something that’s emerged the longer I’ve spent offline – is the place social media holds in our society (I guess western society, as I’d categorize it for this post), and the role in plays in each of our lives.

This post is going to run down a list of thoughts I’ve had about it, though they don’t necessarily have a firm conclusion or even a place I’m trying to get everyone to agree on (which would be a fools’ errand, anyway).

Instead, this is my general thoughts, observations, and considerations on social media as it exists at the time of writing this post.

Maybe it resonates with you, maybe not.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑