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 strip_shortcode_from_excerpt( $content ) { | |
$content = strip_shortcodes( $content ); | |
return $content; | |
} | |
add_filter('the_excerpt', 'strip_shortcode_from_excerpt'); |
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 | |
/** | |
* Changes order of comment form fields for anonymous users. Rating form items first, followed | |
* by comment, author, email and url. Note the comment_form_fields filter is only available since | |
* WordPress 4.4 | |
* | |
* @param array $fields | |
* @return array $fields | |
*/ | |
function my_comment_form_fields( $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 | |
if ( function_exists( 'mrp_rating_result' ) ) { | |
mrp_rating_result(); | |
// you can also pass in parameters such as the the post id if needed e.g. mrp_rating_result( array( 'post_id' => $post_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
<?php | |
// get post id - assumes in WP loop | |
global $post; | |
$post_id = $post->ID; | |
// get default rating form for post, this checks the filter settings, post meta and general settings | |
$rating_form_id = MRP_Utils::get_rating_form( $post_id ); | |
// get current logged in user | |
$user_id = 0; // anonymous |
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_form_id = 1; | |
if ( class_exists( 'MRP_Multi_Rating_API' ) ) { | |
$rating_form = MRP_Multi_Rating_API::get_rating_form( $rating_form_id ); | |
// do something | |
} |
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 | |
/** | |
* Automatically approve ratings > 3 out 5 stars. | |
*/ | |
function my_auto_approve_good_ratings( $auto_approve_ratings, $rating_entry ) { | |
$rating_result = mrp_calculate_rating_entry_result( $rating_entry ); | |
if ( $rating_result['adjusted_star_result'] > 3 ) { | |
return true; |
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 necessary CSS classes for full star, half star and empty star ratings. Note it does | |
* not need to actually be a star. | |
* | |
* @param unknown $icon_classes | |
* @param unknown $icon_font_library | |
* @return string | |
*/ | |
function my_add_icomoon_classes( $icon_classes, $icon_font_library ) { |
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 | |
/** | |
* Add IcoMoon generated fonts to the available font icon libraries in Multi Rating Pro | |
* | |
* @param unknown $icon_font_library_options | |
* @return unknown | |
*/ | |
function my_add_icomoon_font_library_option( $icon_font_library_options ) { | |
$icon_font_library_options['icomoon-faces'] = __( 'IcoMoon Faces', 'multi-rating-pro' ); | |
return $icon_font_library_options; |
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
@font-face { | |
font-family: 'icomoon'; | |
src: url('fonts/icomoon.eot?agusew'); | |
src: url('fonts/icomoon.eot?agusew#iefix') format('embedded-opentype'), | |
url('fonts/icomoon.ttf?agusew') format('truetype'), | |
url('fonts/icomoon.woff?agusew') format('woff'), | |
url('fonts/icomoon.svg?agusew#icomoon') format('svg'); | |
font-weight: normal; | |
font-style: normal; | |
} |
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
.amazon-rating-form { | |
text-align: right; | |
display: inline-block; | |
width: auto; | |
} | |
.amazon-rating-form p, .amazon-rating-form h4, .amazon-rating-form img { | |
text-align: left; | |
} |