Software Engineering in Web Development, Backend Services, and More

Category: Notes (Page 19 of 50)

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

Using Transients For Storing Google Maps Data

A couple of weeks ago, I shared a quick tip on working with multiple InfoWindows with the Google Maps API specifically within the context of WordPress.

Google Maps InfoWindow

When working with this API, there are a number of considerations to take into account each of which is going to depend on how much of the API you’re going to be using; however, one constant that’s going to remain regardless of how much you’re using is the rate limit.

That is, unless you’ve paid Google a decent chunk of change, then you’re going to have to take rate limiting into account whenever you’re working with this API. And if you’re charting quite a few locations for, say, several different pages or several searches, then you can hit that limit quickly.

If you’re not at the point where you can pay Google to up the rate limit, but you’d like to still make sure your project doesn’t totally bomb out if the rate limit is hit, then I recommend using transients to store Google Maps data for an interval of time so that you aren’t making frequent calls to the API.
Continue reading

Quick Tip: Multiple InfoWindows with Google Maps

Recently, I’ve been working with the Google Maps API in order to plot locations that are stored as custom post type meta data in the WordPress database.

Google Maps InfoWindow

 

The general functionality is as follows:

  • For each of the locations stored in the database
  • Generate a pin for the location
  • In addition to creating a pin, create an information window that shows the pin’s location

The information windows that sit above the flags are also called infowindow within the context of the API.

The Google Maps API documentation is pretty good in covering stuff like this, but I did run into a couple of gotchas when working with it, so I thought I’d document them here just in case anyone runs into the same problem.

Continue reading

Searching with Substrings in WordPress

Let’s say you’re in the process of building some type of search mechanism using WP_Query and you want your users to be able to run the search using part of a string.

That is, let’s say that you’re searching Companies (which is a custom post type) and some of the company’s names is “Awesome Code.” The user doesn’t know this because you’ve built a huge database and have been wildly successful with your app.

So let’s say the user opts to try to run a search using the fragment of ‘awe’ or ‘some’ or ‘code’ or some fragment variation thereof – how are we supposed to be able to pull back results like that?

Continue reading

How To Check if a WordPress Term Has a Child

If you’re in the process of working with hierarchical terms, then there’s a chance that you’re eventually going to need to know if a given term is the parent to another term.

For example, let’s say that in one of your templates, you’re responsible for displaying a list of all of the terms that do not have children for one reason or another (or maybe you’re responsible for display only terms with one children or another).

Whatever the case, this is a relatively straightforward operation to do assuming that you have the term’s taxonomy readily available.

Continue reading

My Productivity and Entertainment in 2015

Every year we end up trying out new services, solutions, communities, chat rooms, groups, apps, and other forms of technology that, by the year’s end, may be contributing more noise than signal to our day-to-day.

Perhaps I’m about idealistic, but I think that the majority of us are concerned with making sure that we have the tools that we need to get our work done and nothing more, nothing less (with the occasional game or book for entertainment and/or educational purposes, of course :).

But you get the idea of what I mean: We start off with the best of intentions in getting only what we need in order to get our work done and end up with a plethora of extraneous things that we don’t necessarily need distributed across our various devices.

Then again, maybe I’m the only one who’s suffered from this. But not likely. Here’s a run down of the things that I’m looking to employ day-to-day for both productivity and entertainment.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑