Changeset 13733 for trunk/wp-admin/includes/export.php
- Timestamp:
- 03/17/2010 04:27:25 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/export.php
r13573 r13733 39 39 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); 40 40 41 if ( $post_type and $post_type != 'all' ) { 42 $where = $wpdb->prepare("WHERE post_type = %s ", $post_type); 43 } else { 44 $where = "WHERE post_type != 'revision' "; 45 } 46 if ( $author and $author != 'all' ) { 47 $author_id = (int) $author; 48 $where .= $wpdb->prepare("AND post_author = %d ", $author_id); 49 } 50 if ( $start_date and $start_date != 'all' ) { 51 $where .= $wpdb->prepare("AND post_date >= %s ", $start_date); 52 } 53 if ( $end_date and $end_date != 'all' ) { 54 $where .= $wpdb->prepare("AND post_date < %s ", $end_date); 55 } 56 if ( $category and $category != 'all' ) { 57 $taxomony_id = (int) $category; 58 $where .= $wpdb->prepare("AND ID IN (SELECT object_id FROM {$wpdb->term_relationships} " . "WHERE term_taxonomy_id = %d) ", $taxomony_id); 59 } 60 if ( $status and $status != 'all' ) { 61 $where .= $wpdb->prepare("AND post_status = %s ", $status); 62 } 41 if ( $post_type and $post_type != 'all' ) { 42 $where = $wpdb->prepare("WHERE post_type = %s ", $post_type); 43 } else { 44 $where = "WHERE post_type != 'revision' "; 45 } 46 if ( $author and $author != 'all' ) { 47 $author_id = (int) $author; 48 $where .= $wpdb->prepare("AND post_author = %d ", $author_id); 49 } 50 if ( $start_date and $start_date != 'all' ) { 51 $where .= $wpdb->prepare("AND post_date >= %s ", $start_date); 52 } 53 if ( $end_date and $end_date != 'all' ) { 54 $where .= $wpdb->prepare("AND post_date < %s ", $end_date); 55 } 56 if ( $category and $category != 'all' ) { 57 $taxomony_id = (int) $category; 58 $where .= $wpdb->prepare("AND ID IN (SELECT object_id FROM {$wpdb->term_relationships} " . "WHERE term_taxonomy_id = %d) ", $taxomony_id); 59 } 60 if ( $status and $status != 'all' ) { 61 $where .= $wpdb->prepare("AND post_status = %s ", $status); 62 } 63 63 64 64 // grab a snapshot of post IDs, just in case it changes during the export
Note: See TracChangeset
for help on using the changeset viewer.