Skip to content

Instantly share code, notes, and snippets.

View danielpowney's full-sized avatar

Daniel Powney danielpowney

View GitHub Profile
<?php
/**
* Template Name: My Test Page Pro
*
* This page template is just an example of how you can use the API to display the rating results
* and the rating form using Multi Rating Pro. Twitter Bootstrap 3 scaffolding has used for the grid.
*/
get_header(); ?>
</header>
<?php
$params = array(
'post_id' => 10,
'title' => 'My Rating Form'
);
MRP_Multi_Rating_API::display_rating_form($params);
MRP_Multi_Rating_API::display_rating_result(array(
'post_id' => 10,
'rating_form_id' => 1
));
<?php
global $post;
if (!isset($post_id) isset($post)) {
$post_id = $post->ID;
}
?>
<?php if ( class_exists( 'MRP_Multi_Rating_API' ) ) {
MRP_Multi_Rating_API::display_rating_result( );
} ?>
<?php
MRP_Multi_Rating_API::display_user_rating_results(array(
'no_rating_results_text' => 'No Rating Results',
'show_date' => true,
'echo' => true,
'title' => 'John\'s Results',
'show_filter' => true,
'username' => 'johnsmith'
));
?>
<?php
MRP_Multi_Rating_API::display_rating_result_reviews(array(
'post_id' => "", // means all posts are used
'rating_form_id' => 1,
'show_avatar' => true,
'show_date' => true,
'comments_only' => true,
'echo' => true,
'before_name' => 'Name: ',
'before_comment' => 'Comment: ',
<?php
return MRP_Multi_Rating_API::display_rating_results_list(array(
'show_count' => true,
'title' => 'Top Rating Results',
'rating_form_id' => 1,
'show_filter' => true,
'filter_label_text' => __( 'Choose a category', 'my-text-domain' ),
'filter_button_text' => __( 'Filter', 'my-text-domain' ),
'taxonomy' => 'category',
'term_id' => 0 // for all,
<?php
MRP_Multi_Rating_API::display_rating_form(array(
'title' => 'My Rating Form',
'submit_button_text' => 'Submit Rating',
'update_button_text' => 'Update Rating',
'delete_button_text' => 'Delete Rating',
'show_name_input' => true,
'show_email_input' => false,
'show_comment_textarea' => true,
'echo' => true
<?php
MRP_Multi_Rating_API::display_rating_item_results(array(
'layout' => 'options_block'
));
?>
<?php
MRP_Multi_Rating_API::display_rating_result(array(
'show_rich_snippets' => false,
'show_count' => true,
'echo' => true
));
?>