Changeset 1113 for sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/functions.php
- Timestamp:
- 01/09/2015 01:47:26 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/functions.php
r1106 r1113 607 607 } 608 608 } 609 610 /** 611 * Group an array of WordCamps by year 612 * 613 * @param array $wordcamps 614 * 615 * @return array 616 */ 617 public static function group_wordcamps_by_year( $wordcamps ) { 618 $grouped_wordcamps = array(); 619 620 foreach ( $wordcamps as $wordcamp ) { 621 if ( $year = date( 'Y', get_post_meta( $wordcamp->ID, 'Start Date (YYYY-mm-dd)', true ) ) ) { 622 $grouped_wordcamps[ $year ][] = $wordcamp; 623 } 624 } 625 626 return $grouped_wordcamps; 627 } 609 628 } 610 629
Note: See TracChangeset
for help on using the changeset viewer.