My First WordPress Plugin

I’ve written before about how I added maps to 75CentralPhotography.com, allowing visitors to see the location where each photo was shot (again, with the radical transparency approach I take towards my work). That said, often times, I would like to be able to view a photo’s location while I’m editing photo posts, especially as I’ve been lately updating some older photos with better/more-correct locations. The only way to do that, of course, was to open the post itself in a new tab, which is inefficient and time consuming.

With that in mind, and having previously worked with the leaflet.js library to implement maps on the public-facing side of the site, I thought “why not add a panel to the post edit screen to show a map?”

And so I did.

Introducing GPS Map Preview, a plugin to display GPS coordinates on a map in a post’s admin view.

To get a neat panel on your posts’ admin views like this one, just follow a few simple instructions:

First, you need to install my plugin. To do so, go to its repository on Github and download the latest release.

Then

  1. Log in to your WordPress admin dashboard.
  2. In the left-hand menu, go to Plugins → Add New.
  3. At the top of the page, click the Upload Plugin button.
  4. Click Choose File, then select the ZIP file you downloaded.
  5. Click Install Now.
  6. After installation, click Activate Plugin to enable it.

(You can also manually install via FTP if that’s more in your wheelhouse)

To display the GPS map, you need to add a custom field named GPS to your post. Here’s how:

  1. Log in to your WordPress admin dashboard.
  2. Navigate to Posts → All Posts and either create a new post or edit an existing one.
  3. Enable the “Custom Fields” panel:
    • In the Block Editor (Gutenberg):
      • Click the three-dot menu (⁝) in the top right corner of the editor.
      • Choose Preferences.
      • Go to the Panels tab.
      • Enable the Custom Fields checkbox.
      • Reload the editor page if prompted.
    • In the Classic Editor, custom fields should appear below the content editor by default. If not, click Screen Options at the top-right and check Custom Fields.
  4. Scroll down to the Custom Fields section (usually below the content editor).
  5. Click “Enter New” or select an existing field named GPS.
  6. Enter the value in the format latitude,longitude — for example:
    • 37.7749,-122.4194
  7. Click “Add Custom Field” (if new) or “Update” (if editing).
  8. Update or publish your post.

If your post doesn’t have a custom field called GPS, the plugin will show an error message where it would normally display the map:


Of course, I welcome feedback at matt(at)75central.com. You may also contribute to the plugin by creating a pull request in Github.

Questions? Comments? Concerns?