Making WordPress.org

Changeset 1142


Ignore:
Timestamp:
01/14/2015 05:15:34 PM (11 years ago)
Author:
iandunn
Message:

Central Theme: Require a date to be included on the Past WordCamps template.

Because they're now grouped by year (since r1113), camps that are missing a date were being grouped under 1970 (the start of the Unix epoch).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/functions.php

    r1137 r1142  
    619619
    620620        foreach ( $wordcamps as $wordcamp ) {
    621             if ( $year = date( 'Y', (int) get_post_meta( $wordcamp->ID, 'Start Date (YYYY-mm-dd)', true ) ) ) {
     621            $date = get_post_meta( $wordcamp->ID, 'Start Date (YYYY-mm-dd)', true );
     622
     623            if ( $date && $year = date( 'Y', (int) $date ) ) {
    622624                $grouped_wordcamps[ $year ][] = $wordcamp;
    623625            }
Note: See TracChangeset for help on using the changeset viewer.