Changeset 5530 for sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/functions.php
- Timestamp:
- 05/31/2017 10:18:31 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/functions.php
r4781 r5530 718 718 } 719 719 720 public static function the_wordcamp_date( $wordcamp_id = 0 ) { 720 /** 721 * Output the date or date range of a WordCamp event. 722 * 723 * @param int $wordcamp_id The ID of the WordCamp post. 724 * @param bool $show_year Optional. True to include the year in the date output. 725 */ 726 public static function the_wordcamp_date( $wordcamp_id = 0, $show_year = false ) { 721 727 $start_day = wcpt_get_wordcamp_start_date( $wordcamp_id, 'j' ); 722 728 $start_month = wcpt_get_wordcamp_start_date( $wordcamp_id, 'F' ); … … 724 730 $end_month = wcpt_get_wordcamp_end_date( $wordcamp_id, 'F' ); 725 731 732 if ( $show_year ) { 733 $start_year = wcpt_get_wordcamp_start_date( $wordcamp_id, 'Y' ); 734 $end_year = wcpt_get_wordcamp_end_date( $wordcamp_id, 'Y' ); 735 } 736 726 737 echo "$start_month $start_day"; 738 727 739 if ( $end_day ) { 728 echo '-'; 729 if ( $start_month != $end_month ) 740 if ( $show_year && $start_year !== $end_year ) { 741 echo ", $start_year"; 742 } 743 744 echo '–'; 745 746 if ( $start_month !== $end_month ) { 730 747 echo "$end_month "; 748 } 731 749 732 750 echo $end_day; 751 752 if ( $show_year ) { 753 echo ", $end_year"; 754 } 755 } elseif ( $show_year ) { 756 echo ", $start_year"; 733 757 } 734 758 }
Note: See TracChangeset
for help on using the changeset viewer.