Skip to content

Instantly share code, notes, and snippets.

@iambrianreich
iambrianreich / google-reviews.php
Last active November 12, 2021 21:02
Use the Google Places API to render a Google My Business reviews badge on a WordPress site using shortcodes.
<?php /** @noinspection SpellCheckingInspection */
/**
* This file contains the WordPress code for rendering a Google Reviews badge.
*
* Usage:
*
* 1. Create a Google API Console account if you have not already done so.
* 2. Register for the Google Places API.
* 3. Create an API key.
* 4. Ensure that the API key can be used from wherever this script will execute