Skip to content

Instantly share code, notes, and snippets.

View codeboxr's full-sized avatar
🎯
Focusing

Codeboxr codeboxr

🎯
Focusing
View GitHub Profile
@codeboxr
codeboxr / Code Sample to get rating summary of a post
Created February 18, 2014 06:36
Code Sample to get rating summary of a post
<?php
/*
* If you are in WP loop leave this blank. The id will be automatically inhertited.
*/
$postId = '';
/*
* If you don't know the rating form ID, please go to the "Rating System"->"Rating Form Listing" page from admin
* and get the ID of the rating form. If you yet cannot get the ID leave this blank, the default form will be loaded.
@codeboxr
codeboxr / rating system direct function call
Last active August 29, 2015 13:56
rating system direct function call
//The standalone rating form function is used to show the rating form using direct function call from theme or ther plugin.
/**
* This function add standalone rating form or custom rating form call.
* This will add both rating form and review list both based on form setting and permission
*
* Also it'll not be cached just like as the comment system of wp
*
* @param $form_id rating form id, if empty then will use the default one
* @param $post_id post id, if empty then will use the post id from the loop
* @param $theme_key if empty then will use from default setting