Changeset 14509
- Timestamp:
- 05/07/2010 09:53:11 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/export.php
r14506 r14509 43 43 require_once ('admin-header.php'); 44 44 45 $dateoptions = array();45 $dateoptions = $edateoptions = ''; 46 46 $types = "'" . implode("', '", get_post_types( array( 'public' => true, 'can_export' => true ), 'names' )) . "'"; 47 47 $stati = "'" . implode("', '", get_post_stati( array( 'internal' => false ), 'names' )) . "'"; 48 if ( $monthyears = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month` FROM $wpdb->posts WHERE post_type IN ($types) AND post_status IN ($stati) ORDER BY post_date ASC ") ) { 49 foreach ( $monthyears as $monthyear ) { 50 $dateoptions[] = "\t<option value=\"" . $monthyear->year . '-' . zeroise( $monthyear->month, 2 ) . '">' . $wp_locale->get_month( $monthyear->month ) . ' ' . $monthyear->year . "</option>\n"; 48 if ( $monthyears = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, YEAR(DATE_ADD(post_date, INTERVAL 1 MONTH)) AS `eyear`, MONTH(DATE_ADD(post_date, INTERVAL 1 MONTH)) AS `emonth` FROM $wpdb->posts WHERE post_type IN ($types) AND post_status IN ($stati) ORDER BY post_date ASC ") ) { 49 foreach ( $monthyears as $k => $monthyear ) 50 $monthyears[$k]->lmonth = $wp_locale->get_month( $monthyear->month, 2 ); 51 for( $s = 0, $e = count( $monthyears ) - 1; $e >= 0; $s++, $e-- ) { 52 $dateoptions .= "\t<option value=\"" . $monthyears[$s]->year . '-' . zeroise( $monthyears[$s]->month, 2 ) . '">' . $monthyears[$s]->lmonth . ' ' . $monthyears[$s]->year . "</option>\n"; 53 $edateoptions .= "\t<option value=\"" . $monthyears[$e]->eyear . '-' . zeroise( $monthyears[$e]->emonth, 2 ) . '">' . $monthyears[$e]->lmonth . ' ' . $monthyears[$e]->year . "</option>\n"; 51 54 } 52 55 } … … 70 73 <select name="mm_start" id="mm_start"> 71 74 <option value="all" selected="selected"><?php _e('All Dates'); ?></option> 72 <?php echo implode( '', $dateoptions ); ?>75 <?php echo $dateoptions; ?> 73 76 </select> <br/> 74 77 <strong><?php _e('End:'); ?></strong> 75 78 <select name="mm_end" id="mm_end"> 76 79 <option value="all" selected="selected"><?php _e('All Dates'); ?></option> 77 <?php echo implode( '', array_reverse( $dateoptions ) ); ?>80 <?php echo $edateoptions; ?> 78 81 </select> 79 82 </td>
Note: See TracChangeset
for help on using the changeset viewer.