define( 'WXR_VERSION', '1.2' );
/**
- * Generates the WXR export file for download
+ * Generates the WXR export file for download.
*
* @since 2.1.0
*
- * @param array $args Filters defining what should be included in the export
+ * @global wpdb $wpdb
+ * @global WP_Post $post
+ *
+ * @param array $args Filters defining what should be included in the export.
*/
function export_wp( $args = array() ) {
global $wpdb, $post;
$cat = get_term( $term['term_id'], 'category' );
$cats = array( $cat->term_id => $cat );
unset( $term, $cat );
- } else if ( 'all' == $args['content'] ) {
+ } elseif ( 'all' == $args['content'] ) {
$categories = (array) get_categories( array( 'get' => 'all' ) );
$tags = (array) get_tags( array( 'get' => 'all' ) );
* @return string
*/
function wxr_cdata( $str ) {
- if ( seems_utf8( $str ) == false )
+ if ( ! seems_utf8( $str ) ) {
$str = utf8_encode( $str );
-
+ }
// $str = ent2ncr(esc_html($str));
$str = '<![CDATA[' . str_replace( ']]>', ']]]]><![CDATA[>', $str ) . ']]>';
*
* @since 3.1.0
*
+ * @global wpdb $wpdb
+ *
* @param array $post_ids Array of post IDs to filter the query by. Optional.
*/
function wxr_authors_list( array $post_ids = null ) {
}
}
+ /**
+ *
+ * @param bool $return_me
+ * @param string $meta_key
+ * @return bool
+ */
function wxr_filter_postmeta( $return_me, $meta_key ) {
if ( '_edit_lock' == $meta_key )
$return_me = true;
?>
<?php if ( $post_ids ) {
+ /**
+ * @global WP_Query $wp_query
+ */
global $wp_query;
// Fake being in the loop.
$is_sticky = is_sticky( $post->ID ) ? 1 : 0;
?>
<item>
- <?php /** This filter is documented in wp-includes/feed.php */ ?>
- <title><?php echo apply_filters( 'the_title_rss', $post->post_title ); ?></title>
+ <title><?php
+ /** This filter is documented in wp-includes/feed.php */
+ echo apply_filters( 'the_title_rss', $post->post_title );
+ ?></title>
<link><?php the_permalink_rss() ?></link>
<pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
<dc:creator><?php echo wxr_cdata( get_the_author_meta( 'login' ) ); ?></dc:creator>