Unverified Commit c9320272 authored by Lester Chan's avatar Lester Chan
Browse files

Fixed #84. Added vosts cast to poll answer sort

parent f723ca40
# 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
......@@ -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
......
......@@ -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>
......
......@@ -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()':
......
Supports Markdown
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