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

From JReviews Documentation
Jump to: navigation, search
Line 26: Line 26:
 
add_action( 'jreviews_review_new', 'new_review');
 
add_action( 'jreviews_review_new', 'new_review');
 
</source>
 
</source>
 +
 +
 +
*Download an installable Joomla plugin for JReviews with all event methods in place
 +
[http://docs.reviewsforjoomla.com/downloads/joomla/plugins/plg_jreviews_example.zip plg_jreviews_example.zip]

Revision as of 02:31, 16 October 2014

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_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');


  • Download an installable Joomla plugin for JReviews with all event methods in place
plg_jreviews_example.zip