Unverified Commit 71cfb122 authored by Lester Chan's avatar Lester Chan
Browse files

Fix alignment

parent f6d4c6cc
......@@ -3,8 +3,8 @@ Contributors: GamerZ
Donate link: https://lesterchan.net/site/donation/
Tags: poll, polls, polling, vote, booth, democracy, ajax, survey, post, widget
Requires at least: 4.9.6
Tested up to: 5.4
Stable tag: 2.75.5
Tested up to: 5.5
Stable tag: 2.75.6
Adds an AJAX poll system to your WordPress blog. You can also easily add a poll into your WordPress's blog post/page.
......@@ -26,7 +26,7 @@ I spent most of my free time creating, updating, maintaining and supporting thes
## Changelog
### Version 2.75.6
* NEW: New filter for template variables:
* NEW: New filter for template variables (Props @Liblastic):
wp_polls_template_votebody_variables
wp_polls_template_votefooter
wp_polls_template_resultheader_variables
......@@ -283,7 +283,7 @@ Good practice is to name them for example with prefix `STR_` in the example `STR
}
// Trigger the filter
\add_filter( 'wp_polls_template_resultfooter_variables', 'wp_polls_template_resultfooter_variables' , 10, 1 );
add_filter( 'wp_polls_template_resultfooter_variables', 'wp_polls_template_resultfooter_variables' , 10, 1 );
```
In the admin side just call the custom variable like so and the variable has been translated in the front-end.
`%STR_TOTAL_VOTERS%'`
......@@ -446,17 +446,17 @@ function display_pollvote($poll_id, $display_loading = true) {
$template_question = removeslashes(get_option('poll_template_voteheader'));
$template_question_variables = array(
'%POLL_QUESTION%' => $poll_question_text,
'%POLL_ID%' => $poll_question_id,
'%POLL_TOTALVOTES%' => $poll_question_totalvotes,
'%POLL_TOTALVOTERS%' => $poll_question_totalvoters,
'%POLL_START_DATE%' => $poll_start_date,
'%POLL_END_DATE%' => $poll_end_date,
'%POLL_QUESTION%' => $poll_question_text,
'%POLL_ID%' => $poll_question_id,
'%POLL_TOTALVOTES%' => $poll_question_totalvotes,
'%POLL_TOTALVOTERS%' => $poll_question_totalvoters,
'%POLL_START_DATE%' => $poll_start_date,
'%POLL_END_DATE%' => $poll_end_date,
'%POLL_MULTIPLE_ANS_MAX%' => $poll_multiple_ans > 0 ? $poll_multiple_ans : 1
);
$template_question_variables = apply_filters( 'wp_polls_template_voteheader_variables', $template_question_variables );
$template_question = apply_filters( 'wp_polls_template_voteheader_markup', $template_question, $poll_question, $template_question_variables );
// Get Poll Answers Data
list($order_by, $sort_order) = _polls_get_ans_sort();
......@@ -483,17 +483,17 @@ function display_pollvote($poll_id, $display_loading = true) {
$template_answer = removeslashes( get_option( 'poll_template_votebody' ) );
$template_answer_variables = array(
'%POLL_ID%' => $poll_question_id,
'%POLL_ANSWER_ID%' => $poll_answer_id,
'%POLL_ANSWER%' => $poll_answer_text,
'%POLL_ANSWER_VOTES%' => number_format_i18n( $poll_answer_votes ),
'%POLL_ANSWER_PERCENTAGE%' => $poll_answer_percentage,
'%POLL_ID%' => $poll_question_id,
'%POLL_ANSWER_ID%' => $poll_answer_id,
'%POLL_ANSWER%' => $poll_answer_text,
'%POLL_ANSWER_VOTES%' => number_format_i18n( $poll_answer_votes ),
'%POLL_ANSWER_PERCENTAGE%' => $poll_answer_percentage,
'%POLL_MULTIPLE_ANSWER_PERCENTAGE%' => $poll_multiple_answer_percentage,
'%POLL_CHECKBOX_RADIO%' => $poll_multiple_ans > 0 ? 'checkbox' : 'radio',
'%POLL_CHECKBOX_RADIO%' => $poll_multiple_ans > 0 ? 'checkbox' : 'radio',
);
$template_answer_variables = apply_filters( 'wp_polls_template_votebody_variables', $template_answer_variables );
$template_answer = apply_filters( 'wp_polls_template_votebody_markup', $template_answer, $poll_answer, $template_answer_variables );
$template_answer = apply_filters( 'wp_polls_template_votebody_markup', $template_answer, $poll_answer, $template_answer_variables );
// Print Out Voting Form Body Template
$temp_pollvote .= "\t\t$template_answer\n";
......@@ -512,15 +512,15 @@ function display_pollvote($poll_id, $display_loading = true) {
$template_footer = removeslashes(get_option('poll_template_votefooter'));
$template_footer_variables = array(
'%POLL_ID%' => $poll_question_id,
'%POLL_RESULT_URL%' => $poll_result_url,
'%POLL_START_DATE%' => $poll_start_date,
'%POLL_END_DATE%' => $poll_end_date,
'%POLL_ID%' => $poll_question_id,
'%POLL_RESULT_URL%' => $poll_result_url,
'%POLL_START_DATE%' => $poll_start_date,
'%POLL_END_DATE%' => $poll_end_date,
'%POLL_MULTIPLE_ANS_MAX%' => $poll_multiple_ans > 0 ? $poll_multiple_ans : 1
);
$template_footer_variables = apply_filters( 'wp_polls_template_votefooter_variables', $template_footer_variables );
$template_footer = apply_filters( 'wp_polls_template_votefooter_markup', $template_footer, $poll_question, $template_footer_variables );
$template_footer = apply_filters( 'wp_polls_template_votefooter_markup', $template_footer, $poll_question, $template_footer_variables );
// Print Out Voting Form Footer Template
$temp_pollvote .= "\t\t$template_footer\n";
......
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