This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[mrp_rating_form title="My Rating Form" user_can_update_delete="false" | |
show_comment_textarea="true" submit_button_text="Submit Rating" | |
before_title="<h3>" after_title="</h3>"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_custom_comment_form_validation( $validation_results ) { | |
array_push( $validation_results, array( | |
'severity' => 'error', | |
'name' => 'my_custom_error2', | |
'field' => null, | |
'message' => __( 'My custom error 1', 'my-text-domain' ) | |
) ); | |
return $validation_results; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adds WP loop sort by highest rating then count entries | |
* | |
* @param unknown $order_by | |
* @param unknown $query | |
* @return string | |
*/ | |
function mrp_posts_orderby( $order_by ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.review-details .comment { | |
font-weight: bold; | |
color: #AAA; | |
} | |
.review-meta .name { | |
font-weight: bold; | |
} | |
.user-rating-results .rank, .rating-results-list .rank { | |
font-weight: bold; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.top-rating-results .rank { | |
background-color: #DDDDDD; | |
-webkit-border-radius: 50%; | |
-moz-border-radius: 50%; | |
border-radius: 50%; | |
padding-left: 8px; | |
padding-right: 8px; | |
} | |
.rating-result .percentage-result, .rating-result .score-result { | |
font-weight: bold; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( class_exists( 'MRP_Multi_Rating_API' ) ) { | |
$post_id = get_the_ID(); // must be in the WP loop | |
// if a rating form is not specified in post meta, use default settings | |
$rating_form_id = get_post_meta( $post_id, MRP_Multi_Rating::RATING_FORM_ID_POST_META, true ); | |
if ( $rating_form_id == '' ) { | |
$general_settings = (array) get_option( MRP_Multi_Rating::GENERAL_SETTINGS ); | |
$rating_form_id = $general_settings[ MRP_Multi_Rating::DEFAULT_RATING_FORM_OPTION ]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="rating-form <?php echo $class; ?>"> | |
<?php | |
if ( ! empty( $title ) ) { | |
$before_title = apply_filters( 'mrp_rating_form_before_title', $before_title, $post_id, $rating_form_id ); | |
$after_title = apply_filters( 'mrp_rating_form_after_title', $after_title, $post_id, $rating_form_id ); | |
echo "$before_title" . esc_html( $title ) . "$after_title"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Rating result reviews template | |
*/ | |
?> | |
<div class="rating-result-reviews <?php if ( isset( $class ) ) { echo esc_attr( $class ); } ?>"> | |
<?php | |
if ( $show_filter == true && $taxonomy ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* after count e.g. " ratings)" | |
* @param string $after_count | |
*/ | |
function mrp_rating_result_after_count( $after_count ) { | |
return __( ' ratings)' ); | |
} | |
add_filter( 'mrp_rating_result_after_count', 'mrp_rating_result_after_count' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Sets default rating form for a post based on post type | |
* | |
* @param int $rating_form_id | |
* @param int $post_id | |
* @param array $params | |
* @return $rating_form_id | |
*/ | |
function mrp_default_rating_form_by_post_type( $rating_form_id, $post_id, $params ) { |