Commit 2dbbcf7a authored by Vadim's avatar Vadim

Version 2.0.1

Readme и забытый шорт-код [bg_counter_post_rating]
parent 4000262c
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Plugin Name: Bg Az-Counter Plugin Name: Bg Az-Counter
Plugin URI: https://bogaiskov.ru Plugin URI: https://bogaiskov.ru
Description: Подсчет количества посещений страниц на базе stat.azbyka.ru Description: Подсчет количества посещений страниц на базе stat.azbyka.ru
Version: 2.0 Version: 2.0.1
Author: VBog Author: VBog
Author URI: https://bogaiskov.ru Author URI: https://bogaiskov.ru
License: GPL2 License: GPL2
......
...@@ -250,8 +250,11 @@ function setAllRatings ($request) { ...@@ -250,8 +250,11 @@ function setAllRatings ($request) {
******************************************************************************************/ ******************************************************************************************/
// Регистрируем шорт-код bg_az_rating // Регистрируем шорт-код bg_az_rating
add_shortcode( 'bg_az_rating', 'bg_az_rating_shortcode' ); add_shortcode( 'bg_az_rating', 'bg_az_rating_shortcode' );
// Регистрируем шорт-код bg_counter_post_rating
add_shortcode( 'bg_counter_post_rating', 'bg_counter_post_rating_shortcode' );
// [bg_az_rating] // [bg_az_rating]
// Выводит на экран форму для голосования
function bg_az_rating_shortcode( $atts ) { function bg_az_rating_shortcode( $atts ) {
extract( shortcode_atts( array( extract( shortcode_atts( array(
'type' => null, 'type' => null,
...@@ -267,6 +270,17 @@ function bg_az_rating_shortcode( $atts ) { ...@@ -267,6 +270,17 @@ function bg_az_rating_shortcode( $atts ) {
$quote = bg_az_counter_rating($type, $id); $quote = bg_az_counter_rating($type, $id);
return "{$quote}"; return "{$quote}";
} }
// [bg_counter_post_rating limit='10']
// Выводит на экран список популярных постов
function bg_counter_post_rating_shortcode( $atts ) {
global $post;
extract( shortcode_atts( array(
'limit' => '10',
'number' => false
), $atts ) );
$quote = getPostRating ($limit, 0, (bool)$number);
return "{$quote}";
}
// Склоняем слово "голос" // Склоняем слово "голос"
function bg_counter_txt_votes ($votes){ function bg_counter_txt_votes ($votes){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment