• Hi,

    with the export function in /wp-admin/includes/export.php , i need to do some things:

    – how to generate a xml file automatically with cron, in a specific directory?

    – i want to export only posts of a particular category, how to do that? the function is:

    <?php if ($post_ids) {
    		global $wp_query;
    		$wp_query->in_the_loop = true;  // Fake being in the loop.
    		// fetch 20 posts at a time rather than loading the entire table into memory
    		while ( $next_posts = array_splice($post_ids, 0, 20) ) {
    			$where = "WHERE ID IN (".join(',', $next_posts).")";
    			$posts = $wpdb->get_results("SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");
    				foreach ($posts as $post) {
    			// Don't export revisions.  They bloat the export.
    			if ( 'revision' == $post->post_type )
    				continue;
    			setup_postdata($post); ?>

    bye ??

Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Need to tweak the export function’ is closed to new replies.