WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/25/2011 07:25:45 PM (10 years ago)
Author:
ryan
Message:

Export commentmeta. Props duck_. see #12871

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/export.php

    r17415 r17700  
    385385<?php   wxr_post_taxonomy(); ?>
    386386<?php   $postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) );
    387         if ( $postmeta ) : foreach( $postmeta as $meta ) : if ( $meta->meta_key != '_edit_lock' ) : ?>
     387        foreach( $postmeta as $meta ) : if ( $meta->meta_key != '_edit_lock' ) : ?>
    388388        <wp:postmeta>
    389389            <wp:meta_key><?php echo $meta->meta_key; ?></wp:meta_key>
    390390            <wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
    391391        </wp:postmeta>
    392 <?php   endif; endforeach; endif; ?>
     392<?php   endif; endforeach; ?>
    393393<?php   $comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'", $post->ID ) );
    394         if ( $comments ) : foreach ( $comments as $c ) : ?>
     394        foreach ( $comments as $c ) : ?>
    395395        <wp:comment>
    396396            <wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
     
    406406            <wp:comment_parent><?php echo $c->comment_parent; ?></wp:comment_parent>
    407407            <wp:comment_user_id><?php echo $c->user_id; ?></wp:comment_user_id>
     408<?php       $c_meta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d", $c->comment_ID ) );
     409            foreach ( $c_meta as $meta ) : ?>
     410            <wp:commentmeta>
     411                <wp:meta_key><?php echo $meta->meta_key; ?></wp:meta_key>
     412                <wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
     413            </wp:commentmeta>
     414<?php       endforeach; ?>
    408415        </wp:comment>
    409 <?php   endforeach; endif; ?>
     416<?php   endforeach; ?>
    410417    </item>
    411418<?php
Note: See TracChangeset for help on using the changeset viewer.