WordPress Action Hooks

JReviews implements a number of native WordPress action hooks before and after certain actions.

Overview

If you need to register callbacks in other plugins or in your theme's functions.php file, or prefer this method over the developer events, you can use the list of native action hooks below.

These hooks behave just like the JReviews action hooks which receive data, perform tasks, and return nothing.

Development & Support
Customizations are not included with support. We provide this information to make it easier for developers to extend the functionality. From time to time we may have some availability for custom work. Get in touch to see if there's an opportunity to work together.

Action Hooks

  • jreviews_review_comment_delete
  • jreviews_review_comment_new
  • jreviews_favorite_add
  • jreviews_favorite_remove
  • jreviews_listing_delete
  • jreviews_listing_new
  • jreviews_listing_update
  • jreviews_media_like_yes
  • jreviews_media_like_no
  • jreviews_media_upload
  • jreviews_review_delete
  • jreviews_review_new
  • jreviews_review_vote_yes
  • jreviews_review_vote_no

Example Usage

The $data array contains information about the current action. You can use the functions dd, prx, and PHP's var_dump to look inside the array. However, since most actions take place as Ajax requests, you'll need to use the browser's development tools to inspect the Network / XHR tab to check the output.

You can use this example to execute an action after a new review is published.

add_action('jreviews_review_new', function($data) 
{
  	// Perform tasks here
});