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 | |
/** | |
* Recalculate rating item results for a post and rating form | |
* | |
* @param unknown $post_id | |
* @param unknown $rating_form_id | |
*/ | |
function mrp_recalculate_rating_item_results( $post_id, $rating_form_id ) { | |
$rating_form = MRP_Multi_Rating_API::get_rating_form( $rating_form_id ); |
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-star-rating, .mrp-thumbs { | |
font-size: 150%; | |
} |
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 | |
/** | |
* Makes optional fields required | |
* | |
* @param unknown $validation_results | |
* @param unknown $fields | |
* @return $validation_results | |
*/ | |
function mrp_optional_fields_validation( $validation_results, $fields ) { | |
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 post_tag taxonomy terms that are allowed to do auto placement | |
* | |
* @param boolean $can_apply_filter | |
* @param string $filter_name | |
* @param string $value | |
* @param int $post_id | |
* @return $can_apply_filter | |
*/ |
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 post_tag taxonomy terms that are allowed to do wp comment integration | |
* | |
* @param boolean $can_apply_filter | |
* @param string $filter_name | |
* @param string $value | |
* @param int $post_id | |
* @return $can_apply_filter | |
*/ |
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 | |
function mrp_posts_fields( $posts_fields ) { | |
if ( is_main_query() ) { | |
$sticky_posts = get_option( 'sticky_posts' ); | |
if ( is_array( $sticky_posts ) && ! empty( $sticky_posts ) ) { | |
$sticky_posts = implode( ', ', $sticky_posts ); |
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 category | |
* | |
* @param int $rating_form_id | |
* @param int $post_id | |
* @param array $params | |
* @return $rating_form_id | |
*/ | |
function mrp_default_rating_form_by_category( $rating_form_id, $post_id, $params ) { |
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 | |
$query = new WP_Query( array( 'mrp_sort_highest_rated' => true ) ); | |
/** | |
* Adds WP query sort by highest rating then count entries | |
* | |
* @param unknown $order_by | |
* @param unknown $query | |
* @return string | |
*/ |
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 "http://schema.org/Recipe" microdata with aggregateRating. Replaces the default | |
* "http://schema.org/Article" | |
* | |
* @param unknown $microdata | |
* @param unknown $rating_form_id | |
* @param unknown $post_id | |
* @param unknown $rating_result | |
* @return string |
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 | |
function my_include_minus( $include_minus ) { | |
return false; | |
} | |
add_filter( 'mrp_rating_form_include_minus', 'my_include_minus', 10, 1 ); |