rating, author name, date and price of the product. It'll help you to get more click through rate and better visibility in Google search engine.
* Author: Rajesh Namase
* Version: 1.1
* Author URI: http://www.techlila.com/
* License: GPLv2 or later
*/
/*
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
define('AUTHOR_PRODUCT_REVIEW_VERSION', '1.1');
include plugin_dir_path(__FILE__).'options.php';
function add_author_product_review($content) {
global $wp_query;
if( get_post_type() != 'post' || !is_single())
return $content;
$max_rate = get_option('review-max-rating', 5);
$min_rate = get_option('review-interval-rating', 0.5);
$show_rate = get_option('review-show-rating', 1);
$fill_style = get_option('review-fill-style', 'horizontal');
$postID = $wp_query->post->ID;
$name = get_post_meta($postID, 'schema_product_name', true);
$price = get_post_meta($postID, 'schema_product_price', true);
$price_currency = get_post_meta($postID, 'schema_price_currency', true);
$rating = (float) get_post_meta($postID, 'schema_rating', true);
if($rating < $min_rate)
return str_replace('{rating}', '', $content);
if(!$show_rate){
$style = ' style="display: none;"';
} else {
$style = '';
}
$customPlacement = strpos($content, '{rating}') !== false;
if($customPlacement){
$custom = '