WP-Polls - Version 2.75.2

Version Description

Download this release

Release Info

Developer GamerZ
Plugin Icon WP-Polls
Version 2.75.2
Comparing to
See all releases

Code changes from version 2.75.1 to 2.75.2

Files changed (2) hide show
  1. readme.txt +4 -1
  2. wp-polls.php +49 -27
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://lesterchan.net/site/donation/
4
  Tags: poll, polls, polling, vote, booth, democracy, ajax, survey, post, widget
5
  Requires at least: 4.9.6
6
  Tested up to: 5.0
7
- Stable tag: 2.75.1
8
 
9
  Adds an AJAX poll system to your WordPress blog. You can also easily add a poll into your WordPress's blog post/page.
10
 
@@ -24,6 +24,9 @@ WP-Polls is extremely customizable via templates and css styles and there are to
24
  I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.
25
 
26
  ## Changelog
 
 
 
27
  ### Version 2.75.1
28
  * FIXED: Use array() instead of [] as a few users are still on < PHP 5.4. Props @bearlydoug.
29
  * FIXED: pollq_expiry is now 0 instead of blank string. Props @hpiirainen.
4
  Tags: poll, polls, polling, vote, booth, democracy, ajax, survey, post, widget
5
  Requires at least: 4.9.6
6
  Tested up to: 5.0
7
+ Stable tag: 2.75.2
8
 
9
  Adds an AJAX poll system to your WordPress blog. You can also easily add a poll into your WordPress's blog post/page.
10
 
24
  I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.
25
 
26
  ## Changelog
27
+ ### Versiob 2.75.2
28
+ * FIXED: Missing str_replace for wp_polls_template filter
29
+
30
  ### Version 2.75.1
31
  * FIXED: Use array() instead of [] as a few users are still on < PHP 5.4. Props @bearlydoug.
32
  * FIXED: pollq_expiry is now 0 instead of blank string. Props @hpiirainen.
wp-polls.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP-Polls
4
  Plugin URI: https://lesterchan.net/portfolio/programming/php/
5
  Description: Adds an AJAX poll system to your WordPress blog. You can easily include a poll into your WordPress's blog post/page. WP-Polls is extremely customizable via templates and css styles and there are tons of options for you to choose to ensure that WP-Polls runs the way you wanted. It now supports multiple selection of answers.
6
- Version: 2.75.1
7
  Author: Lester 'GaMerZ' Chan
8
  Author URI: https://lesterchan.net
9
  Text Domain: wp-polls
@@ -29,7 +29,7 @@ Text Domain: wp-polls
29
  */
30
 
31
  ### Version
32
- define( 'WP_POLLS_VERSION', '2.75.1' );
33
 
34
 
35
  ### Create Text Domain For Translations
@@ -445,15 +445,23 @@ function display_pollvote($poll_id, $display_loading = true) {
445
 
446
  $template_question = removeslashes(get_option('poll_template_voteheader'));
447
 
448
- $template_question = apply_filters( 'wp_polls_template_voteheader_markup', $template_question, $poll_question, array(
449
- '%POLL_QUESTION%' => $poll_question_text,
450
- '%POLL_ID%' => $poll_question_id,
451
- '%POLL_TOTALVOTES%' => $poll_question_totalvotes,
452
- '%POLL_TOTALVOTERS%' => $poll_question_totalvoters,
453
- '%POLL_START_DATE%' => $poll_start_date,
454
- '%POLL_END_DATE%' => $poll_end_date,
455
- '%POLL_MULTIPLE_ANS_MAX%' => $poll_multiple_ans > 0 ? $poll_multiple_ans : 1
456
- ));
 
 
 
 
 
 
 
 
457
 
458
  // Get Poll Answers Data
459
  list($order_by, $sort_order) = _polls_get_ans_sort();
@@ -479,15 +487,23 @@ function display_pollvote($poll_id, $display_loading = true) {
479
  $poll_multiple_answer_percentage = $poll_question_totalvoters > 0 ? round( ( $poll_answer_votes / $poll_question_totalvoters ) * 100 ) : 0;
480
  $template_answer = removeslashes( get_option( 'poll_template_votebody' ) );
481
 
482
- $template_answer = apply_filters( 'wp_polls_template_votebody_markup', $template_answer, $poll_answer, array(
483
- '%POLL_ID%' => $poll_question_id,
484
- '%POLL_ANSWER_ID%' => $poll_answer_id,
485
- '%POLL_ANSWER%' => $poll_answer_text,
486
- '%POLL_ANSWER_VOTES%' => number_format_i18n( $poll_answer_votes ),
487
- '%POLL_ANSWER_PERCENTAGE%' => $poll_answer_percentage,
488
- '%POLL_MULTIPLE_ANSWER_PERCENTAGE%' => $poll_multiple_answer_percentage,
489
- '%POLL_CHECKBOX_RADIO%' => $poll_multiple_ans > 0 ? 'checkbox' : 'radio'
490
- ));
 
 
 
 
 
 
 
 
491
 
492
  // Print Out Voting Form Body Template
493
  $temp_pollvote .= "\t\t$template_answer\n";
@@ -505,13 +521,19 @@ function display_pollvote($poll_id, $display_loading = true) {
505
  // Voting Form Footer Variables
506
  $template_footer = removeslashes(get_option('poll_template_votefooter'));
507
 
508
- $template_footer = apply_filters( 'wp_polls_template_votefooter_markup', $template_footer, $poll_question, array(
509
- '%POLL_ID%' => $poll_question_id,
510
- '%POLL_RESULT_URL%' => $poll_result_url,
511
- '%POLL_START_DATE%' => $poll_start_date,
512
- '%POLL_END_DATE%' => $poll_end_date,
513
- '%POLL_MULTIPLE_ANS_MAX%' => $poll_multiple_ans > 0 ? $poll_multiple_ans : 1
514
- ));
 
 
 
 
 
 
515
 
516
  // Print Out Voting Form Footer Template
517
  $temp_pollvote .= "\t\t$template_footer\n";
3
  Plugin Name: WP-Polls
4
  Plugin URI: https://lesterchan.net/portfolio/programming/php/
5
  Description: Adds an AJAX poll system to your WordPress blog. You can easily include a poll into your WordPress's blog post/page. WP-Polls is extremely customizable via templates and css styles and there are tons of options for you to choose to ensure that WP-Polls runs the way you wanted. It now supports multiple selection of answers.
6
+ Version: 2.75.2
7
  Author: Lester 'GaMerZ' Chan
8
  Author URI: https://lesterchan.net
9
  Text Domain: wp-polls
29
  */
30
 
31
  ### Version
32
+ define( 'WP_POLLS_VERSION', '2.75.2' );
33
 
34
 
35
  ### Create Text Domain For Translations
445
 
446
  $template_question = removeslashes(get_option('poll_template_voteheader'));
447
 
448
+ $template_question = apply_filters( 'wp_polls_template_voteheader_markup', str_replace( array(
449
+ '%POLL_QUESTION%',
450
+ '%POLL_ID%',
451
+ '%POLL_TOTALVOTES%',
452
+ '%POLL_TOTALVOTERS%',
453
+ '%POLL_START_DATE%',
454
+ '%POLL_END_DATE%',
455
+ '%POLL_MULTIPLE_ANS_MAX%'
456
+ ), array(
457
+ $poll_question_text,
458
+ $poll_question_id,
459
+ $poll_question_totalvotes,
460
+ $poll_question_totalvoters,
461
+ $poll_start_date,
462
+ $poll_end_date,
463
+ $poll_multiple_ans > 0 ? $poll_multiple_ans : 1
464
+ ), $template_question ) );
465
 
466
  // Get Poll Answers Data
467
  list($order_by, $sort_order) = _polls_get_ans_sort();
487
  $poll_multiple_answer_percentage = $poll_question_totalvoters > 0 ? round( ( $poll_answer_votes / $poll_question_totalvoters ) * 100 ) : 0;
488
  $template_answer = removeslashes( get_option( 'poll_template_votebody' ) );
489
 
490
+ $template_answer = apply_filters( 'wp_polls_template_votebody_markup', str_replace( array(
491
+ '%POLL_ID%',
492
+ '%POLL_ANSWER_ID%',
493
+ '%POLL_ANSWER%',
494
+ '%POLL_ANSWER_VOTES%',
495
+ '%POLL_ANSWER_PERCENTAGE%',
496
+ '%POLL_MULTIPLE_ANSWER_PERCENTAGE%' ,
497
+ '%POLL_CHECKBOX_RADIO%'
498
+ ), array(
499
+ $poll_question_id,
500
+ $poll_answer_id,
501
+ $poll_answer_text,
502
+ number_format_i18n( $poll_answer_votes ),
503
+ $poll_answer_percentage,
504
+ $poll_multiple_answer_percentage,
505
+ $poll_multiple_ans > 0 ? 'checkbox' : 'radio'
506
+ ), $template_answer ) );
507
 
508
  // Print Out Voting Form Body Template
509
  $temp_pollvote .= "\t\t$template_answer\n";
521
  // Voting Form Footer Variables
522
  $template_footer = removeslashes(get_option('poll_template_votefooter'));
523
 
524
+ $template_footer = apply_filters( 'wp_polls_template_votefooter_markup', str_replace( array(
525
+ '%POLL_ID%',
526
+ '%POLL_RESULT_URL%',
527
+ '%POLL_START_DATE%',
528
+ '%POLL_END_DATE%',
529
+ '%POLL_MULTIPLE_ANS_MAX%'
530
+ ), array(
531
+ $poll_question_id,
532
+ $poll_result_url,
533
+ $poll_start_date,
534
+ $poll_end_date,
535
+ $poll_multiple_ans > 0 ? $poll_multiple_ans : 1
536
+ ), $template_footer ) );
537
 
538
  // Print Out Voting Form Footer Template
539
  $temp_pollvote .= "\t\t$template_footer\n";