WordPress.org

Ready to get started?Download WordPress

Forums

Need to tweak the export function (7 posts)

  1. csseur3
    Member
    Posted 5 years ago #

    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 :)

  2. csseur3
    Member
    Posted 5 years ago #

    nobody? :(

  3. csseur3
    Member
    Posted 5 years ago #

    help please :(

  4. csseur3
    Member
    Posted 5 years ago #

    up ...

  5. csseur3
    Member
    Posted 5 years ago #

    up.

  6. csseur3
    Member
    Posted 5 years ago #

    up :(

  7. csseur3
    Member
    Posted 5 years ago #

    up :/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags