Documentation
How do I set it up?
You’ll need WordPress 6.5 or later and PHP 8.0 or later. Gravity Forms is only needed if you want your own review form, and WooCommerce only if you want to show your product reviews. Review photos need PHP’s GD extension.
Step 1: Install the plugin
Log in to your WordPress site and go to Plugins → Add Plugin → Upload Plugin. Upload the zip from your purchase, then install and activate it.
Step 2: Activate your license
Go to Reviews → Settings and open the License tab. Paste your key into License Key and click Activate License.

You need an active license to import reviews and to collect them from your forms. Reviews already on your site keep showing either way.
Step 3: Add your API keys
On the Settings tab, add the API key for each service you want to import from, then click Save Changes. Review sources below explains where to find each one. WooCommerce doesn’t need a key.
Step 4: Add a source
Go to Reviews → Sources → Add Source, choose the service under Import from, pick your listing and click Publish. Your reviews import straight away, and the Import status box shows how it went.

Step 5: Show your reviews
Edit any page, add the Business Reviews block and pick a layout. Using a page builder? Use the shortcode instead.
FAQs
What do I need from Google?
There are two routes, and it depends on how many reviews you want to show. A Google API key is the quick one: it shows up to five of your reviews at a time, because that’s all Google gives out through this route. Each time the plugin checks (daily by default), it asks Google again and adds any new reviews it gets, so your collection can grow past five over time. To show every review, with your replies, you connect your Google Business Profile, and Google has to approve that first. You apply once, and the steps are under Google (Places API) and Google Business Profile. Already use BrightLocal? It can bring in the Google reviews your reports collect, without applying to Google.
Do I need Gravity Forms?
Only to collect reviews with your own form. Importing and showing reviews works without it.
Can I import Facebook reviews?
Not straight from Facebook. BrightLocal, Birdeye and Yext sources bring in the Facebook reviews those services collect. The CSV import takes Facebook reviews exported from another tool.
Can I import Yelp or Tripadvisor reviews?
There’s no Yelp or Tripadvisor source, because their terms don’t allow keeping their reviews on another site. BrightLocal, Birdeye and Yext sources skip Yelp reviews for the same reason.
Will it slow down my site?
No. The reviews are built into your page, so they show right away. The carousel’s code only loads on pages that have a carousel, and new reviews are fetched in the background, so visitors never wait.
How many sites can I use it on?
As many as your license covers: 1, 3, 10 or unlimited sites. Every license includes every feature; the tiers differ only in how many sites you can use it on.
Can I get a refund?
Yes. Every purchase comes with a 15-day money-back guarantee: you can ask for a full refund within 15 days of buying or renewing. The details are in our Refund Policy.
Review sources
Each source brings in the reviews for one listing, and you can add as many as you need, from any mix of services. New reviews come in daily by default. To change that, use Reviews → Settings → Check sources for new reviews: Daily, Weekly or Only when I click Import now. Trustpilot and WooCommerce sources always check every 12 hours.

Google (Places API)
The quickest way to start. All you need is a Google API key, and you’ll get up to five reviews.
- In the Google Cloud console, turn on Places API (New) for your project and create an API key.
- Restrict the key by IP address (your web server’s), not by website. Imports run on your server, and Google blocks website-restricted keys there.
- Paste it into Reviews → Settings → Google API key and save.
- Add a source with Import from set to Google (Places API). Search for your business under Find the business and pick it. The Google Place ID fills in for you.
Google returns up to five reviews. Usually they’re the five Google calls “most relevant”, but if your Google Cloud project also has the older Places API turned on, you get the five newest. The source’s Import status box says which. Each import counts as one request on your Google Cloud bill.
Google review retention decides what happens to reviews Google stops returning: keep them, or delete the ones Google hasn’t returned for 30 days. See Compliance settings.
Google Business Profile
Shows every review on a Google listing you manage, with your replies, and keeps each review up to date if the reviewer edits it.
Before you start: you need a Google Cloud project that Google has approved for the Business Profile APIs. You apply to Google once for that project. Until it’s approved, this source can’t list your locations. Already using BrightLocal? A BrightLocal source brings in the Google reviews your reports collect, without applying to Google.
- In your approved project, create an OAuth client of the Web application type.
- In Reviews → Settings, enter the OAuth client ID and OAuth client secret and save.
- Copy the redirect URL shown under Google account into the OAuth client’s Authorized redirect URIs. Every site needs its own.
- Click Connect Google and sign in with the Google account that manages your listing.
- Add a source with Import from set to Google Business Profile, and pick the location under Business Profile location.
To change permissions, use Reconnect Google, not Disconnect.
Reviews that Google translated show the translation, marked “Translated by Google”, with a See original button for the reviewer’s own words.
Two settings decide how these reviews are kept: Business Profile review storage (keep every review, or delete the ones Google hasn’t returned for 30 days) and Averages (whether they count in averages that mix in other sources). See Compliance settings.
BrightLocal Reputation Manager
Imports every review your Reputation Manager reports collect, from Google, Facebook and the other sites BrightLocal monitors.
Add your BrightLocal API key in Reviews → Settings, then add a source and choose the report under Reputation Manager report. Use Platforms to import to leave out platforms another source already covers.
Birdeye
Imports the reviews a Birdeye business has published, from Google, Facebook and the other sites Birdeye collects from. Private feedback sent straight to the business is never imported.
In Birdeye, find your API key under Settings → Integrations → API (not every Birdeye plan includes API access) and paste it into Birdeye API key. When you add the source, enter the numeric Birdeye Business ID. Birdeye support can give it to you.
Yext
Imports every live review Yext monitors for a location, with the owner’s public replies. You’ll need Yext Reviews.
In the Yext Developer Console, create an app with read access to Reviews and paste its API key into Yext API key. When you add the source, enter the location’s Yext Entity ID.
Trustpilot
You’ll need your own Trustpilot API key (the Client ID from your Trustpilot Business account) and a paid Trustpilot plan with the API add-on. Paste the key into Trustpilot API key.
When you add the source, enter your profile’s domain (example.com), its Trustpilot address or its Business Unit ID under Trustpilot profile. Trustpilot sources check every 12 hours and keep your copy matching Trustpilot: new reviews are added, edited ones updated and deleted ones removed. Feeds with Trustpilot reviews add a credit line with your TrustScore and a link to your Trustpilot profile.
Turn on Failed syncs (off by default) to hide a source’s reviews whenever its sync hasn’t worked for 24 hours. They come back after the next successful sync.

WooCommerce
Shows your store’s approved product reviews, and it doesn’t need an API key. When you add the source, choose All products or one product category under Products. Approving, editing or deleting a review in WooCommerce updates your copy straight away.
Each review names its product, linked to the product page, and says “Verified buyer” where WooCommerce marked the reviewer as a verified owner. If one source covers All products and another covers a category, each review is stored once: the category source gets that category’s reviews, and All products gets the rest.

Adding a review by hand
For a review from anywhere else, go to Reviews → Add Review. Choose its Platform (Facebook, BBB, Houzz and more), or Other with your own name for it. Reviews you add this way are approved when you publish them.
Platforms to import and shared reviews
When two sources bring in the same review, Business Reviews stores it once and it belongs to both. A feed filtered to either source shows it, and it’s deleted only when no source still holds it. Each source’s screen says how many of its reviews another source also imports.
BrightLocal, Birdeye and Yext collect reviews from several platforms, so their sources have Platforms to import. Untick a platform another source already covers, such as Google when a Google Business Profile source covers the same location. Reviews of an unticked platform are deleted unless another source also imports them.

Approving reviews
Imported reviews
Each source has three settings that decide what comes in:
- Approve imported reviews automatically is on by default. Untick it to hold each new review for approval.
- Skip reviews below leaves out ratings under the stars you choose. Skipped reviews aren’t saved. To keep them but hide them on a page, use the block’s Minimum rating instead.
- Skip star-only reviews with no written text leaves out reviews with no words.
Google Business Profile, Trustpilot and WooCommerce sources also update the reviews you already have. If a reviewer edits a review on a source that holds reviews for approval, it goes back to pending, and so does any updated review that no longer passes its source’s settings.
The Reviews screen
Reviews → All Reviews lists every review with its rating, platform, tags and status, and the menu shows how many are pending. Use Approve, Unapprove and Reject on one review, or on many from Bulk actions. You can filter the list by platform and rating.

Open a review to edit its text, rating, photos, date or Owner reply. The Moderation box shows its status, with buttons to change it.

Approval emails
When your review form holds a review, your moderators get an email. The Approve and Reject buttons open a confirmation page, so you can check the review before anything changes. They work without logging in, so the person approving doesn’t need a WordPress account, and they expire after 14 days.


The email goes to the feed’s Send it to addresses. If that’s empty, it uses Reviews → Settings → Send approval requests to, and if that’s empty too, your site’s admin email.
Collecting reviews with Gravity Forms
Any Gravity Form can collect reviews. Each entry becomes a review in your library.
Step 1: Add the Star Rating field
In the form editor, add the Star Rating field from Advanced Fields. Visitors pick from one to five stars, with a mouse or the keyboard. Add fields for the reviewer’s name and review, and a File Upload field if you’d like photos.

Step 2: Add a Business Reviews feed
Go to the form’s Settings → Business Reviews and click Add New. Under Form fields, match Reviewer name, Rating and Review text to your fields. Reviewer email, Headline, Reviewer photo and Review photos are optional. The email is never shown on your site.

Step 3: Choose how reviews are approved
- New reviews: Hold every review for approval (the default), Publish high ratings, hold the rest, or Publish every review straight away.
- Publish straight away when rated: 5 stars or 4 stars or more, for the second option. Approve held reviews for what they say, not for their stars: hiding low ratings while implying you show them all breaks US rules.
- Approval email and Send it to: who gets the email with the Approve and Reject buttons.
- Tell reviewers when you approve their review: emails the reviewer when you approve a held review, with the Subject and Message you set. {name}, {site} and {review} are replaced. It needs the reviewer’s email mapped, and reviews published straight away send nothing.
- Review tags adds tags to every review from this form, so you can show them in a feed of their own. Condition limits the feed to entries that match.

To put approve and reject links in a Gravity Forms notification of your own, use the {business_review_approve_url} and {business_review_reject_url} merge tags. They’re filled in only in notifications sent to addresses you typed or to {admin_email}, and left empty in any other.
Review photos
Map a File Upload field to Review photos. To take more than one photo, turn on Enable Multi-File Upload on that field and allow the jpg, jpeg, png and webp extensions. A Maximum File Size of 10 MB matches the plugin’s own limit.
- The first six files of a review are used, each a JPEG, PNG or WebP of up to 10 MB and 25 million pixels. Other files are refused and noted on the entry.
- Each photo is saved again as a new image, without its location or other camera data. Gravity Forms keeps the original upload with the entry.
- A review with a photo always waits for approval. The approval email, the confirmation page and the review screen show the photos first, and the review screen can remove any of them.
- The copies stay out of the Media Library. They’re ordinary files, so anyone with a copy’s exact address can open it.
On the page, a review shows up to four photos, the last one counting how many more there are. Clicking a photo opens a larger view.

Importing from a spreadsheet
Have reviews in a spreadsheet? Import Facebook reviews exported from another tool, reviews from another reviews plugin, or testimonials you’ve already collected.
- Save your spreadsheet as CSV, with column names in the first row. Each review needs text or a rating. The import screen’s Download a sample file link shows the format.
- Go to Reviews → Import, choose the file and click Upload and match columns.
- Under Match columns, pick the column for each review field. Then set Platform when a row has none, whether imported reviews are approved now or held, any Review tags, and whether Dates are written day first.
- Click Preview to check each row, then click Import.


The review fields are Reviewer name, Rating (1–5), Review text, Review date, Platform, Headline, Link to the review, Reviewer photo URL, Reviewer email (never shown), Owner reply and Review ID. Platform names such as “Google”, “GMB” or “FB” are recognized, and any other name is kept as written.
A file can hold up to 2 MB and 2,000 reviews. Importing the same file again skips the reviews you already have. The CSV import needs an active license.
Showing reviews
Add the Business Reviews block to any page or template. Its settings are in four panels:
- Which reviews: the platforms, imported sources and tags to include (leave a group empty to include everything), Minimum rating, Only reviews with written text, Order and Maximum reviews.
- Layout: the layout, columns, how many reviews show before a “Show more” button, lines before “Read more”, the carousel’s autoplay and loop, and the Color scheme.
- Show: the rating summary, star breakdown, reviewer photos, dates, platform badges, owner replies and Google attribution.
- Review buttons: see Review buttons.

Layouts
Grid lines reviews up in rows of one to four columns, or Auto-fit, which shows as many columns as fit, about 290px each.

Masonry packs cards of different heights into columns.

List stacks reviews in one column, shown here with dates like “3 days ago”.

Carousel slides through one to four reviews at a time, with optional autoplay that pauses while someone hovers over it.

Rating badge only shows the summary without the reviews.

For a compact feed, turn off reviewer photos, dates and platform badges and set Lines before “Read more” to 2.

Color schemes
Light and Dark suit plain sections. Transparent takes on the colors of the section it sits in. Dark frost and Light frost are frosted glass, for photos and bold backgrounds.




When every review in a feed comes from one platform, such as Google, the summary shows that platform’s logo and name, as in the dark frost example above.
Minimum rating and the summary
Minimum rating hides lower ratings. The summary then counts only the reviews shown, so it says so, for example “Based on 20 reviews rated 4★ and up”. Don’t present a filtered feed as all your reviews: the FTC’s rule on consumer reviews (16 CFR 465.7) forbids it.

More display options
- Reviews → Settings → Platform logo puts the platform logo in the card’s corner, or on the reviewer’s photo. Reviews with no photo keep it in the corner.
- Dates as “3 days ago”, in the block’s Show panel, writes dates relative to today.
- Feeds with Google reviews show Google’s attribution and how the reviews are sorted, such as “Reviews from Google Maps · Newest first”.
- Reviews are part of the page’s HTML, so they show without JavaScript and search engines can read them.
Shortcodes
Use a shortcode anywhere shortcodes work, such as a page builder or a widget. [pb_business_reviews] takes the same options as the block, for example:
[pb_business_reviews platforms="google,website" layout="carousel" columns="3" min_rating="4" autoplay="5"]
| Option | Block setting, values and default |
|---|---|
platforms | Platforms: a comma-separated list of website (Our website), store (Our store), google, facebook, yelp, trustpilot, tripadvisor, bbb, houzz, angi, nextdoor, other. Default: All |
sources | Imported sources: comma-separated source IDs (the number in a source’s edit link). Default: All |
tags | Tags: comma-separated tag slugs, from Reviews → Tags. Default: All |
min_rating | Minimum rating: 0–5. Default: 0 |
require_text | Only reviews with written text: 1 or 0. Default: 0 |
order | Order: newest, oldest, highest, lowest, random. Default: newest |
limit | Maximum reviews: 1–200. Default: 12 |
layout | Layout: grid, masonry, list, carousel, badge. Default: grid |
columns | Columns, or Reviews visible at once: 1–4, or auto (grid and masonry only). Default: 3 |
per_page | Show at first: 0–200 (0 shows them all). Default: 6 |
clamp_lines | Lines before “Read more”: 0–20 (0 shows the full review). Default: 5 |
autoplay | Autoplay every (seconds): 0–30 (0 turns it off). Default: 0 |
loop | Loop back to the start: 1 or 0. Default: 0 |
theme | Color scheme: light, dark, transparent, frost-dark, frost-light. Default: light |
show_summary | Rating summary: 1 or 0. Default: 1 |
show_distribution | Star breakdown in the summary: 1 or 0. Default: 0 |
show_avatar | Reviewer photo or initials: 1 or 0. Default: 1 |
show_date | Review date: 1 or 0. Default: 1 |
relative_dates | Dates as “3 days ago”: 1 or 0. Default: 0 |
show_platform | Platform badge: 1 or 0. Default: 1 |
show_reply | Owner replies: 1 or 0. Default: 1 |
show_attribution | Google attribution: 1 or 0. Default: 1 |
show_buttons | Show review buttons: 1 or 0. Default: 0 |
button_platforms | Review buttons platforms: a comma-separated list of google, facebook, trustpilot, website. Default: Every saved link |
For the 1 or 0 options, true and false or yes and no work too.
[pb_business_reviews_buttons] shows the review buttons on their own, the same as the Review Buttons block. With no review links saved, it shows nothing.
[pb_business_reviews_buttons platforms="google,trustpilot" justify="center"]
| Option | Values and default |
|---|---|
platforms | Comma-separated: google, facebook, trustpilot, website. Empty shows every saved link. Default: Every saved link |
theme | light, dark, transparent, frost-dark, frost-light. Default: light |
justify | left, center, right. Default: left |
Review buttons
Save your review links under Reviews → Settings → Review links: Google, Facebook, Trustpilot and Your own review form. Until you save the links, Google is suggested from your one Business Profile location or Places source, and Trustpilot from your one Trustpilot source.
For Google, the best link is the review link from your Business Profile (Ask for reviews), because the Place ID link may not open on iPhone Safari. Your own form’s button says “Write a review” and can point to a page or a section, such as /leave-a-review/ or #review-form.
Then turn on Show review buttons in the block’s Review buttons panel, and tick platforms if you only want some. Or add the Review Buttons block on its own, for example on a thank-you page. In a summary for a single platform, that platform’s link becomes one tinted “Write a review” button.

Everyone sees the same buttons. Showing review links only to happy customers breaks Google’s and Trustpilot’s rules, and Yelp bans asking for reviews at all, so there’s no Yelp button.
Reviews → Settings → Button style sets how every Business Reviews button looks, including “Show more reviews”: Plugin (our rounded buttons in the feed’s colors), Theme (your theme’s button style) or None (unstyled, for your own CSS). Extra button classes adds your own classes to every button.

Deleting a source
When you delete a source permanently, with Delete Permanently, a bulk delete or Empty Trash, Business Reviews asks what to do with the reviews only that source imported:
- Keep the reviews (the default): they stay in your review library and your feeds, with no source.
- Delete them too: deleted reviews can’t be brought back. A new source imports only what the service still returns, which for Google Places is five reviews.

Deleting a Trustpilot source also offers Hide the kept Trustpilot reviews, since Trustpilot’s terms allow showing its reviews only while a sync keeps them current. Reviews another source holds, and reviews added by hand, from a form or from a CSV file, stay either way. When WordPress empties the trash on its own, the reviews are kept.
Compliance settings
Google and Trustpilot have rules about showing their reviews on other sites. These settings help you follow them, and whether you turn them on is up to you.
| Setting and where | What the other choice does |
|---|---|
| Google review retention Reviews → Settings → Google (Places API) | Deletes Places reviews Google hasn’t returned for 30 days, which usually leaves five. Google’s Maps Platform terms don’t allow storing Places API reviews. Default: Keep every Google review once it is imported |
| Business Profile review storage Reviews → Settings → Google Business Profile | Deletes reviews Google hasn’t returned for 30 days. Google’s Business Profile terms require this 30-day rule. Default: Keep every review, even after Google stops returning it |
| Averages: Count Business Profile reviews in combined averages Reviews → Settings → Google Business Profile | Off leaves Business Profile reviews out of the rating and count of feeds that mix sources, as Google’s Business Profile terms require. Default: On |
| Failed syncs Reviews → Settings → Trustpilot | On hides a Trustpilot source’s reviews while its sync hasn’t succeeded for 24 hours. Trustpilot’s terms require your copy to match theirs within 24 hours. Default: Off |
| Hide the kept Trustpilot reviews The screen shown when you delete a Trustpilot source | Ticked hides the Trustpilot reviews you keep after deleting their source. Default: Unticked |
Some rules are built in rather than settings: feeds with Google reviews carry Google’s attribution (the block’s Google attribution toggle, required when Google reviews show), feeds with Trustpilot reviews carry Trustpilot’s credit line, review buttons look the same to every visitor, and a summary says when a minimum rating is set.
Settings reference
Reviews → Settings
| Setting | Options and default |
|---|---|
| Google API key Google (Places API) | A server key restricted by IP address, with Places API (New) turned on Default: Empty |
| Google review retention Google (Places API) | Keep every Google review once it is imported; Delete Google reviews the Places API has not returned for 30 days Default: Keep |
| OAuth client ID and OAuth client secret Google Business Profile | From a Web application OAuth client in a Google Cloud project that Google has approved for the Business Profile APIs Default: Empty |
| Business Profile review storage Google Business Profile | Keep every review, even after Google stops returning it; Delete reviews Google has not returned for 30 days Default: Keep |
| Averages Google Business Profile | Count Business Profile reviews in combined averages Default: On |
| Google account Google Business Profile | Connect Google, Reconnect Google, Disconnect Default: Not connected |
| BrightLocal API key BrightLocal Reputation Manager | From your BrightLocal account Default: Empty |
| Birdeye API key Birdeye | From Birdeye: Settings → Integrations → API Default: Empty |
| Yext API key Yext | From an app in the Yext Developer Console with read access to Reviews Default: Empty |
| Trustpilot API key Trustpilot | The Client ID from your Trustpilot Business account Default: Empty |
| Failed syncs Trustpilot | Hide a source’s reviews when its sync has not succeeded for 24 hours Default: Off |
| Check sources for new reviews Imports | Daily; Weekly; Only when I click Import now Default: Daily |
| Send approval requests to Moderation | Comma-separated email addresses Default: The site admin email |
| Platform logo Review cards | In the card’s corner; On the reviewer’s photo Default: In the card’s corner |
| Google, Facebook, Trustpilot, Your own review form Review links | A link each Default: Suggested from your sources until you save |
| Button style Buttons | Plugin; Theme; None Default: Plugin |
| Extra button classes Buttons | Class names separated by spaces Default: Empty |
| Data Uninstall | Delete all reviews, sources and settings when the plugin is deleted Default: Off |
Sources (Reviews → Sources → Add Source)
| Setting | Options and default |
|---|---|
| Import from | Google (Places API), Google Business Profile, BrightLocal Reputation Manager, Birdeye, Yext, Trustpilot, WooCommerce Default: Google (Places API) |
| The listing | Google Place ID (found with Find the business), Business Profile location, Reputation Manager report, Birdeye Business ID, Yext Entity ID, Trustpilot profile, or Products (All products or a category) Default: Empty |
| Platforms to import | The platforms a BrightLocal, Birdeye or Yext source can bring in Default: All ticked |
| New reviews | Approve imported reviews automatically Default: On |
| Skip reviews below | Import every rating; ★★ to ★★★★★ Default: Import every rating |
| Text | Skip star-only reviews with no written text Default: Off |
Gravity Forms feed (Form Settings → Business Reviews)
| Setting | Options and default |
|---|---|
| Name | Any name Default: Business Reviews |
| Form fields | Reviewer name, Rating and Review text (required); Reviewer email, Headline, Reviewer photo and Review photos (optional) Default: Matched by field label where possible |
| New reviews | Hold every review for approval; Publish high ratings, hold the rest; Publish every review straight away Default: Hold every review for approval |
| Publish straight away when rated | 5 stars; 4 stars or more Default: 5 stars |
| Approval email | On or off Default: On |
| Send it to | Comma-separated email addresses Default: Reviews → Settings → Send approval requests to |
| Tell reviewers when you approve their review | On or off Default: Off |
| Subject | Text; {name} and {site} are replaced Default: Your review of {site} is live |
| Message | Text; {name}, {site} and {review} are replaced Default: A short thank-you saying the review is published |
| Review tags | Comma-separated tags Default: Empty |
| Condition | Gravity Forms conditional logic Default: Off |
Translations
Business Reviews is ready to translate, but it doesn’t include any translations yet. It ships with a translation template, languages/pb-business-reviews.pot.
To translate it into your language, use the free Loco Translate plugin. If you’ve never used Loco Translate before, here’s a tutorial written for beginners.
Hooks & filters
For developers. Put these in a small plugin of your own or your child theme’s functions.php. To add your own review source, see “Add your own review source” in the plugin’s readme.txt.
Change or skip reviews on import
pb_business_reviews_import_review (filter): Changes a review just before an import or CSV import saves it or updates its saved copy. Return false to skip it. It gets the review, the source ID (0 for a CSV import) and the saved copy’s ID (0 for a new review). Changes to the platform, external ID and source are ignored, so later imports still find the copy.
// Shorten reviewers' surnames to an initial, and skip reviews that mention a competitor.
add_filter( 'pb_business_reviews_import_review', function ( $review, $source_id, $existing_id ) {
if ( false !== stripos( $review['text'], 'Acme Builders' ) ) {
return false;
}
$review['author_name'] = preg_replace( '/^(\S+)\s+(\S).*$/u', '$1 $2.', $review['author_name'] );
return $review;
}, 10, 3 );When a review is stored
pb_business_reviews_review_created (action): Fires after a review is stored, from any source, with the review’s ID and its data.
// Email the site admin when a 1 or 2 star review arrives.
add_action( 'pb_business_reviews_review_created', function ( $post_id, $data ) {
if ( $data['rating'] > 0 && $data['rating'] <= 2 ) {
wp_mail( get_option( 'admin_email' ), 'New low rating', admin_url( 'post.php?post=' . $post_id . '&action=edit' ) );
}
}, 10, 2 );When a review is approved
pb_business_reviews_review_approved (action): Fires when a held review is approved, with the review post and its previous status.
// Clear WP Rocket's cache so the newly approved review shows.
add_action( 'pb_business_reviews_review_approved', function ( $post, $old_status ) {
if ( function_exists( 'rocket_clean_domain' ) ) {
rocket_clean_domain();
}
}, 10, 2 );After a source import
pb_business_reviews_source_imported (action): Fires after a source import finishes, with the source ID and the counts: added, seen, skipped, updated and removed.
add_action( 'pb_business_reviews_source_imported', function ( $source_id, $counts ) {
error_log( sprintf( '%s: %d new, %d updated, %d removed', get_the_title( $source_id ), $counts['added'], $counts['updated'], $counts['removed'] ) );
}, 10, 2 );Change the approval email
pb_business_reviews_approval_email (filter): Filters the approval email before it’s sent: its recipients (to, a list of addresses), subject and HTML body. The second argument is the review ID.
add_filter( 'pb_business_reviews_approval_email', function ( $email, $review_id ) {
$email['to'][] = 'manager@example.com';
$email['subject'] = 'Please check: ' . $email['subject'];
return $email;
}, 10, 2 );Use your own feed template
pb_business_reviews_feed_template (filter): Filters the path of the feed template. Copy views/display/feed.php from the plugin into your theme to change the markup.
add_filter( 'pb_business_reviews_feed_template', function ( $template, $options ) {
$custom = locate_template( 'business-reviews/feed.php' );
return $custom ? $custom : $template;
}, 10, 2 );Change the carousel settings
pb_business_reviews_swiper_options (filter): Filters the Swiper options of a review carousel. The second argument holds the feed’s display options.
add_filter( 'pb_business_reviews_swiper_options', function ( $swiper, $options ) {
$swiper['speed'] = 600;
return $swiper;
}, 10, 2 );Add a review platform
pb_business_reviews_platforms (filter): Filters the list of review platforms, keyed by slug. Each has a label, a brand color, a star color, a star shape (star, box or bubble) and an icon URL.
add_filter( 'pb_business_reviews_platforms', function ( $platforms ) {
$platforms['thumbtack'] = array(
'label' => 'Thumbtack',
'color' => '#009fd9',
'stars' => '#009fd9',
'shape' => 'star',
'icon' => plugins_url( 'thumbtack.svg', __FILE__ ),
);
return $platforms;
} );Change shortcode defaults
shortcode_atts_pb_business_reviews (filter): WordPress’s standard shortcode filter changes the defaults of [pb_business_reviews]. shortcode_atts_pb_business_reviews_buttons does the same for the buttons shortcode.
// Show relative dates in every shortcode feed that doesn't set relative_dates itself.
add_filter( 'shortcode_atts_pb_business_reviews', function ( $out, $pairs, $atts ) {
if ( ! isset( $atts['relative_dates'] ) ) {
$out['relative_dates'] = '1';
}
return $out;
}, 10, 3 );