Changeset 13573 for trunk/wp-admin/export.php
- Timestamp:
- 03/03/2010 04:45:40 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/export.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/export.php
r11764 r13573 18 18 19 19 if ( isset( $_GET['download'] ) ) { 20 $author = isset($_GET['author']) ? $_GET['author'] : 'all'; 21 export_wp( $author ); 20 $author = isset($_GET['author']) ? $_GET['author'] : 'all'; 21 $category = isset($_GET['category']) ? $_GET['category'] : 'all'; 22 $post_type = isset($_GET['post_type']) ? stripslashes_deep($_GET['post_type']) : 'all'; 23 $status = isset($_GET['status']) ? stripslashes_deep($_GET['status']) : 'all'; 24 $mm_start = isset($_GET['mm_start']) ? $_GET['mm_start'] : 'all'; 25 $mm_end = isset($_GET['mm_end']) ? $_GET['mm_end'] : 'all'; 26 $aa_start = isset($_GET['aa_start']) ? intval($_GET['aa_start']) : 0; 27 $aa_end = isset($_GET['aa_end']) ? intval($_GET['aa_end']) : 0; 28 if($mm_start != 'all' && $aa_start > 0) { 29 $start_date = sprintf( "%04d-%02d-%02d", $aa_start, $mm_start, 1 ); 30 } else { 31 $start_date = 'all'; 32 } 33 if($mm_end != 'all' && $aa_end > 0) { 34 if($mm_end == 12) { 35 $mm_end = 1; 36 $aa_end++; 37 } else { 38 $mm_end++; 39 } 40 $end_date = sprintf( "%04d-%02d-%02d", $aa_end, $mm_end, 1 ); 41 } else { 42 $end_date = 'all'; 43 } 44 export_wp( $author, $category, $post_type, $status, $start_date, $end_date ); 22 45 die(); 23 46 } 24 47 25 48 require_once ('admin-header.php'); 26 ?> 49 50 $months = ""; 51 for ( $i = 1; $i < 13; $i++ ) { 52 $months .= "\t\t\t<option value=\"" . zeroise($i, 2) . '">' . 53 $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) ) . "</option>\n"; 54 } ?> 27 55 28 56 <div class="wrap"> … … 38 66 <table class="form-table"> 39 67 <tr> 68 <th><label for="mm_start"><?php _e('Restrict Date'); ?></label></th> 69 <td><strong><?php _e('Start:'); ?></strong> <?php _e('Month'); ?> 70 <select name="mm_start" id="mm_start"> 71 <option value="all" selected="selected"><?php _e('All Dates'); ?></option> 72 <?php echo $months; ?> 73 </select> <?php _e('Year'); ?> 74 <input type="text" id="aa_start" name="aa_start" value="" size="4" maxlength="5" /> 75 </td> 76 <td><strong><?php _e('End:'); ?></strong> <?php _e('Month'); ?> 77 <select name="mm_end" id="mm_end"> 78 <option value="all" selected="selected"><?php _e('All Dates'); ?></option> 79 <?php echo $months; ?> 80 </select> <?php _e('Year'); ?> 81 <input type="text" id="aa_end" name="aa_end" value="" size="4" maxlength="5" /> 82 </td> 83 </tr> 84 <tr> 40 85 <th><label for="author"><?php _e('Restrict Author'); ?></label></th> 41 86 <td> … … 46 91 foreach ( $authors as $id ) { 47 92 $o = get_userdata( $id ); 48 echo "<option value=' " . esc_attr($o->ID) . "'>$o->display_name</option>";93 echo "<option value='{$o->ID}'>{$o->display_name}</option>\n"; 49 94 } 50 95 ?> 96 </select> 97 </td> 98 </tr> 99 <tr> 100 <th><label for="category"><?php _e('Restrict Category'); ?></label></th> 101 <td> 102 <select name="category" id="category"> 103 <option value="all" selected="selected"><?php _e('All Categories'); ?></option> 104 <?php 105 $categories = (array) get_categories('get=all'); 106 if($categories) { 107 foreach ( $categories as $cat ) { 108 echo "<option value='{$cat->term_taxonomy_id}'>{$cat->name}</option>\n"; 109 } 110 } 111 ?> 112 </select> 113 </td> 114 </tr> 115 <tr> 116 <th><label for="post_type"><?php _e('Restrict Content'); ?></label></th> 117 <td> 118 <select name="post_type" id="post_type"> 119 <option value="all" selected="selected"><?php _e('All Content'); ?></option> 120 <option value="page"><?php _e('Pages'); ?></option> 121 <option value="post"><?php _e('Posts'); ?></option> 122 </select> 123 </td> 124 </tr> 125 <tr> 126 <th><label for="status"><?php _e('Restrict Status'); ?></label></th> 127 <td> 128 <select name="status" id="status"> 129 <option value="all" selected="selected"><?php _e('All Statuses'); ?></option> 130 <option value="draft"><?php _e('Draft'); ?></option> 131 <option value="private"><?php _e('Privately published'); ?></option> 132 <option value="publish"><?php _e('Published'); ?></option> 133 <option value="future"><?php _e('Scheduled'); ?></option> 51 134 </select> 52 135 </td>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)