Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 127 of 219)

Articles, tips, and resources for WordPress-based development.

Displaying Google Maps in WordPress

If you’ve been following along with this particular series, then you’ve got a template setup and ready to begin displaying Google Maps in WordPress.

For whatever reason, if you’ve just stumbled across this series, then I’ve shared a basic introduction of the topic as well as how to setup a template within Twentyfifteen in WordPress 4.2.2 or how to display a map.

Those particular articles were a little longer than I usually like to share for posts like this, but I needed to get a few things setup before actually diving into the main points of this series.

Case in point: In this post, I’m primarily going to be talking about how to communicate with the Google Maps API to simply display a map – that’s it. Nothing more. Sure, there’s a lot more that can be done, and I plan to cover a lot of that material, but for now we just need to get a map displaying in our template.

Continue reading

Integrating Google Maps in WordPress

As mentioned in the first post in this series, I’m going to be talking about a few of the different Google Maps APIs and how we can integrate them into our WordPress projects.

Rather than actually build a plugin that covers this material, I’m going to be creating a template to demonstrate some of this functionality. Though I’m a strong advocate for separating functionality and presentation, the work required to get a plugin up and running requires a lot of boilerplate code.

That isn’t inherently a bad thing, but I thought it’d be a chance of pace to simply introduce a template and then begin adding the necessary code from there (and making any changes to functions.php from there).

At the end of the series, we can then take a look and see how to abstract all of the work that we’ve done into a child theme to use.

Continue reading

Using The Google Maps API and WordPress

One of the challenges that comes with working with any new API is learning how to use it. And by that, I mean generally overcoming the learning curve – and I believe that this

Some libraries and frameworks have some relatively easy APIs once you grok the basics (and I think WordPress falls into this camp), and others don’t necessarily have the easiest APIs (such as, say, Google Maps).

The thing is, it’s different for all of us. What’s easy for me may not be easy for you and vice versa, and that’s okay. I think we need to stop treating one another as if it says something about our intelligence if we aren’t able to pick up something as fast as someone else.

That’s probably content for another post.

Anyway, for the past few months, I’ve been doing more work with the Google Maps API than I’ve ever done thus far in my career. All of the work as been done within the context of WordPress, but none of it has been WordPress-specific.

By that, I mean that the work that I’ve done is used within a WordPress plugin but there’s nothing that requires WordPress for it to run – the code could be abstracted and generalized into a standard PHP application and used.

I don’t write about that, though. I tend to keep my focus on what it’s like to work with WordPress in a professional capacity. So over the next few posts, I thought it might worth taking a look at some of the ways that you may want to employ the Google Maps API in your project, what it entails, and how to get started with it so you have some clue as to what you’re doing whenever you need to build something with the API.

Continue reading

Validating Input via the WordPress Settings API

This post is part of a series on Sanitization with the WordPress Settings API. Here is Part 4.

Up to this point, everything we’ve talked about regarding the WordPress Settings API and saving data to the database has been based around two ideas:

  1. We need to sanitize the input
  2. We haven’t been concerned with any particular fields being required

At this point though, we’re ready to start talking about how to tackle this particular issue. Since we’re already familiar with how to sanitize the data, we’re going to build off of the code that we already have.

An Example Settings Page

An Example Settings Page

That is, we’re going to look at how to validate the following fields:

  • Address 1
  • City
  • Postal Code

Furthermore, we’re going to see how to tackle this from an object-oriented approach, we’re going to look at what’s needed in order to add an error message if the required input is invalid, and we’re also going to look at how to prevent saving information to the database if it’s empty or invalid.

Continue reading

The Complexity of WordPress Solutions

Yesterday, I was talking with a friend of mine about WordPress and some of the annual revenue reports that have come out over the past few months (which tends to be the normal around the end of the year and on into the first quarter for our industry).

Though he’s no longer working in this particular economy, he mentioned something that I thought was interesting:

the work I’m working on right now is far more exciting and challenging BUT the opportunity to make stupid simple money is pretty large in the WP world

Before I go any further, I want to be clear that I am taking this quote out of context so it’s probably not presenting him in the best light. That isn’t my intent at all.

In fact, I actually think he makes a compelling point that I’ll talk about momentarily, but I also think that the problems that we opt to solve in and/or with WordPress are as challenging as we accept and as we allow them to be.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑