Plugin Directory

Changeset 1237326


Ignore:
Timestamp:
09/03/2015 02:07:45 PM (11 years ago)
Author:
Moisture
Message:

Fix event list ordering.

Location:
am-events/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • am-events/trunk/am-events.php

    r1236114 r1237326  
    44  Plugin URI: http://wordpress.org/extend/plugins/am-events/
    55  Description: Adds a post type for events and a customizable widget for displaying upcoming events.
    6   Version: 1.9.6
     6  Version: 1.9.7
    77  Author: Atte Moisio
    88  Author URI: http://attemoisio.fi
     
    9494 */
    9595require_once dirname(__FILE__) . '/widget-upcoming-events.php';
     96//require_once dirname(__FILE__) . '/widget-event-calendar.php';
    9697require_once dirname(__FILE__) . '/template-tags.php';
    9798 
     
    173174            $end = "$this_year-12-31 23:59:59";
    174175            $query->set( 'meta_query', am_get_archive_meta_query($start, $end) );     
     176            am_pre_modify_query($query);
    175177        } else if (is_month()) { // Monthly archive page
    176178            $start = "$this_year-$this_month-01 00:00:00";
    177179            $end = "$this_year-$this_month-31 23:59:59";
    178180            $query->set( 'meta_query', am_get_archive_meta_query($start, $end) );
     181            am_pre_modify_query($query);
    179182        } else if (is_day()) { // Daily archive page
    180183            $start = "$this_year-$this_month-$this_day 00:00:00";
    181184            $end = "$this_year-$this_month-$this_day 23:59:59";
    182185            $query->set( 'meta_query', am_get_archive_meta_query($start, $end) );
     186            am_pre_modify_query($query);
    183187        }
    184188
    185         $query->set( 'post_type', 'am_event' );
    186         $query->set( 'meta_key', 'am_startdate' );
    187         $query->set( 'orderby', 'meta_value' );
    188         $query->set( 'order', 'ASC' );
    189         $query->set( 'year', null);
    190         $query->set( 'monthnum', null);
    191         $query->set( 'day', null);
    192 
    193189    }
     190}
     191
     192function am_pre_modify_query($query) {
     193    $query->set( 'post_type', 'am_event' );
     194    $query->set( 'meta_key', 'am_startdate' );
     195    $query->set( 'orderby', 'meta_value' );
     196    $query->set( 'order', 'ASC' );
     197    $query->set( 'year', null);
     198    $query->set( 'monthnum', null);
     199    $query->set( 'day', null);
    194200}
    195201
     
    215221function am_register_widgets() {
    216222    register_widget('AM_Upcoming_Events_Widget');
     223    //register_widget('AM_Event_Calendar_Widget');
    217224}
    218225
  • am-events/trunk/readme.txt

    r1236114 r1237326  
    44Requires at least: 3.3.1
    55Tested up to: 4.3
    6 Stable tag: 1.9.6
     6Stable tag: 1.9.7
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5656== Changelog ==
    5757
     58= 1.9.7 =
     59* Fixed admin panel event list ordering
     60
    5861= 1.9.6 =
    59 * Fix tags being stripped from recurring events.
     62* Fixed tags being stripped from recurring events
    6063
    6164= 1.9.5 =
     
    132135== Upgrade Notice ==
    133136
     137= 1.9.7 =
     138* Fixes admin panel event list ordering.
     139
    134140= 1.9.6 =
    135 * Fixes tags being stripped from recurring events.
     141* Fixes tags being stripped from recurring events
    136142
    137143= 1.9.5 =
Note: See TracChangeset for help on using the changeset viewer.