WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Default sort by Start Date

[Resolved] Default sort by Start Date

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author YOP
    Participant

    @yourownprogrammer

    Hi wm,

    Edit admin.php and in view_all_polls() function replace

    $orderby                    = ( empty ( $orderby ) ) ? 'name' : $orderby;

    with

    $orderby                    = ( empty ( $orderby ) ) ? 'start_date' : $orderby;

    Best wishes,

    YOP Team

    Piani
    Participant

    @webbmasterpianise

    Thanks for a fast answer. Its in the right area and solve some of my question.

    1. A would like to have the order reversed (DESC) where to add this?

    2. This adjustment seems to not affect the page “Yop Poll Logs”.

    Plugin Author YOP
    Participant

    @yourownprogrammer

    Hey wm,

    1. In view_all_polls() function add

    if($order=="")
                         $order="desc";

    before

    $yop_polls               = Yop_Poll_Model::get_yop_polls_filter_search( $orderby, $order, $filter, $search );

    2. For YOP Poll Logs we can sort them only after Vote Date. Let us know if you are interested and we will provide the code.

    Regards,

    YOP Team

    Piani
    Participant

    @webbmasterpianise

    Thanks for another superfast answer. The code you provided solved my request perfect.

    public function view_all_polls() {
    			global $page, $action, $orderby, $order, $current_user;
    			$orderby                    = ( empty ( $orderby ) ) ? 'start_date' : $orderby; $order="desc";

    As the members only (mostly) are interrested in the latest poll it would be great to be able to sort the “Yop poll logs” in the same way after “vote date, desc”. Thanks in advance is you look into this in the future.

    Plugin Author YOP
    Participant

    @yourownprogrammer

    Hey wm,

    We will take your suggestion into consideration and try to implement it in the future.

    Best wishes,

    YOP Team

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Default sort by Start Date’ is closed to new replies.