"Star rating" field. Add-on to Advanced Custom Fields plugin.
Add the possibility to use rating field in ACF.
Plug-in provide three calculation method for voting:
If “calculated by cookies” is selected, the only users which use browser with
cookies enabled will be able to vote
In field settings you can also:
Use the_field($field_key, $post_id) or get_field($field_key, $post_id) function
in page template for field output (see ACF documentation).
In admin panel the rating is inactive.
Attention! Before removing the plugin files read uninstall.php
Languages: English, Français, Русский
I apologize for possible mistakes in plugin translation.
I will be glad to accept the help with the correct translation of a plugin into
English and to correction of my mistakes.
Thanks to Ivan Shamshur for JS.
French Translation – thanks to Nicolas Kern.
This ACF field type is compatible with: ACF 4
For developers: https://github.com/lienann/acf-starrating
acf-starrating
folder into your wp-content/plugins
folderAdd the_field($field_key, $post_id) or get_field($field_key, $post_id) into page
template where it is necessary for you (use $field_name only, if you are sure that field value exists):
<?php // add fields in the Loop if ( have_posts() ) { while ( have_posts() ) { the_post(); if ( function_exists( 'the_field' ) ) { the_field( 'quality', $post->ID ); } the_content(); } // end while } // end if ?> <?php // display rating field for post_id=123 if ( function_exists( 'the_field' ) ) { the_field( 'interest', '123' ); the_field( 'field_62ad11se531h', '123' ); } ?> <?php // display rating field of user_id = 1 // to pass $post_id value use 'user_' + user ID format if ( function_exists( 'get_field' ) ) { $field = get_field( 'field_53ac25b2e521', 'user_1' ); echo $field; } ?>
For detailed information about this functions see ACF documentation.
Use get_field() function of ACF plugin (with the third option = FALSE), to display
vote result on the page: