Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Markus Hermann
wp-polls
Commits
c9320272
Unverified
Commit
c9320272
authored
Jan 19, 2017
by
Lester Chan
Browse files
Fixed #84. Added vosts cast to poll answer sort
parent
f723ca40
Changes
4
Hide whitespace changes
Inline
Side-by-side
.editorconfig
0 → 100644
View file @
c9320272
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
[{.jshintrc,*.json,*.yml}]
indent_style = space
indent_size = 2
[{*.txt,wp-config-sample.php}]
end_of_line = crlf
\ No newline at end of file
README.md
View file @
c9320272
...
...
@@ -28,6 +28,7 @@ I spent most of my free time creating, updating, maintaining and supporting thes
## Changelog
### Version 2.73.3
*
NEW: Added sort by votes casted to poll answers.
*
FIXED: Do not display poll option is not respected when poll is closed.
### Version 2.73.2
...
...
polls-options.php
View file @
c9320272
...
...
@@ -233,6 +233,7 @@ if( isset($_POST['Submit']) && $_POST['Submit'] ) {
<th
scope=
"row"
valign=
"top"
>
<?php
_e
(
'Sort Poll Answers By:'
,
'wp-polls'
);
?>
</th>
<td>
<select
name=
"poll_ans_sortby"
size=
"1"
>
<option
value=
"polla_votes"
<?php
selected
(
'polla_votes'
,
get_option
(
'poll_ans_sortby'
));
?>
>
<?php
_e
(
'Votes Cast'
,
'wp-polls'
);
?>
</option>
<option
value=
"polla_aid"
<?php
selected
(
'polla_aid'
,
get_option
(
'poll_ans_sortby'
));
?>
>
<?php
_e
(
'Exact Order'
,
'wp-polls'
);
?>
</option>
<option
value=
"polla_answers"
<?php
selected
(
'polla_answers'
,
get_option
(
'poll_ans_sortby'
));
?>
>
<?php
_e
(
'Alphabetical Order'
,
'wp-polls'
);
?>
</option>
<option
value=
"RAND()"
<?php
selected
(
'RAND()'
,
get_option
(
'poll_ans_sortby'
));
?>
>
<?php
_e
(
'Random Order'
,
'wp-polls'
);
?>
</option>
...
...
wp-polls.php
View file @
c9320272
...
...
@@ -1535,9 +1535,9 @@ function manage_poll() {
if
(
empty
(
$text
))
{
echo
'<p style="color: green;">'
.
sprintf
(
__
(
'Poll \'%s\' Deleted Successfully'
,
'wp-polls'
),
wp_kses_post
(
removeslashes
(
$pollq_question
)
)
)
.
'</p>'
;
}
// Update Lastest Poll ID To Poll Options
$latest_pollid
=
polls_latest_id
();
$update_latestpoll
=
update_option
(
'poll_latestpoll'
,
$latest_pollid
);
update_option
(
'poll_latestpoll'
,
polls_latest_id
()
);
do_action
(
'wp_polls_delete_poll'
,
$pollq_id
);
break
;
}
...
...
@@ -1550,6 +1550,7 @@ function manage_poll() {
function
_polls_get_ans_sort
()
{
$order_by
=
get_option
(
'poll_ans_sortby'
);
switch
(
$order_by
)
{
case
'polla_votes'
:
case
'polla_aid'
:
case
'polla_answers'
:
case
'RAND()'
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment