plugin_init();
}
return $instance;
}
/**
* Initialize the plugin
*
* @return void
*/
public function plugin_init() {
add_action( 'admin_menu', array($this, 'admin_menu' ));
add_action( 'admin_init', array($this, 'register_settings' ));
add_action( 'wp_footer', array($this, 'register_function' ));
}
/**
*
*
* @return
*/
public function admin_menu() {
add_menu_page( __( 'Aggregate Rating', 'aggregate-rating' ), __( 'Aggregate Rating', 'aggregate-rating' ), 'manage_options', 'aggregate-rating', array($this, 'aggregate_rating_cb_func'), 'dashicons-heart', 6 );
}
/**
*
*
* @return
*/
public function aggregate_rating_cb_func(){
?>
post_name, $page_slug)){
$key = array_search ($post->post_name, $page_slug);
if(esc_attr( get_option('rating_count')[$key])) {
$rating_count = esc_attr( get_option('rating_count')[$key]);
} else {
$rating_count = 4.9;
}
if(esc_attr( get_option('rating_scale')[$key])) {
$rating_scale = esc_attr( get_option('rating_scale')[$key]);
} else {
$rating_scale = 5;
}
if(esc_attr( get_option('rating_votes')[$key])) {
$rating_votes = esc_attr( get_option('rating_votes')[$key]);
} else {
$rating_votes = 100;
}
if(esc_attr( get_option('price_range')[$key])) {
$price_range = esc_attr( get_option('price_range')[$key]);
} else {
$price_range = null;
}
?>
Rated /
based on customer reviews
,
Phone: