Changeset 14506
- Timestamp:
- 05/07/2010 08:51:01 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/export.php
r14444 r14506 43 43 require_once ('admin-header.php'); 44 44 45 $dateoptions = ''; 46 if ( $monthyears = $wpdb->get_results( "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC " ) ) { 45 $dateoptions = array(); 46 $types = "'" . implode("', '", get_post_types( array( 'public' => true, 'can_export' => true ), 'names' )) . "'"; 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 ") ) { 47 49 foreach ( $monthyears as $monthyear ) { 48 $dateoptions .= "\t<option value=\"" . $monthyear->year . '-' . zeroise( $monthyear->month, 2 ) . '">' . $wp_locale->get_month( $monthyear->month ) . ' ' . $monthyear->year . "</option>\n";50 $dateoptions[] = "\t<option value=\"" . $monthyear->year . '-' . zeroise( $monthyear->month, 2 ) . '">' . $wp_locale->get_month( $monthyear->month ) . ' ' . $monthyear->year . "</option>\n"; 49 51 } 50 52 } … … 68 70 <select name="mm_start" id="mm_start"> 69 71 <option value="all" selected="selected"><?php _e('All Dates'); ?></option> 70 <?php echo ($dateoptions); ?>72 <?php echo implode( '', $dateoptions ); ?> 71 73 </select> <br/> 72 74 <strong><?php _e('End:'); ?></strong> 73 75 <select name="mm_end" id="mm_end"> 74 76 <option value="all" selected="selected"><?php _e('All Dates'); ?></option> 75 <?php echo $dateoptions; ?>77 <?php echo implode( '', array_reverse( $dateoptions ) ); ?> 76 78 </select> 77 79 </td>
Note: See TracChangeset
for help on using the changeset viewer.