Difference between revisions of "JReviews WordPress action hooks for use in WordPress plugins"

From JReviews Documentation
Jump to: navigation, search
(List of available actions)
 
Line 1: Line 1:
 +
<div class="successbox" style="width: 95%">
 +
 +
[https://www.jreviews.com/docs/developers/wordpress-action-hooks There's a new version of this article]
 +
 +
</div>
 +
 
== List of available actions ==
 
== List of available actions ==
  

Latest revision as of 16:38, 29 July 2020

List of available actions

  • 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

The first parameter is the object id. The second parameter is an array with useful info related to the object. For example, you can use this in your WordPress plugin to execute an action after a new review has been submitted.


function new_review($review_id, $data) {
   // Your action logic goes here. The $data array contains more information about the listing and the review.
}
 
 
add_action( 'jreviews_review_new', 'new_review');