<?php
-
+/**
+ * RSS Importer
+ *
+ * @package WordPress
+ * @subpackage Importer
+ */
+
+/**
+ * RSS Importer
+ *
+ * Will process a RSS feed for importing posts into WordPress. This is a very
+ * limited importer and should only be used as the last resort, when no other
+ * importer is available.
+ *
+ * @since unknown
+ */
class RSS_Import {
var $posts = array ();
function header() {
echo '<div class="wrap">';
+ screen_icon();
echo '<h2>'.__('Import RSS').'</h2>';
}
echo '</div>';
}
+ function _normalize_tag( $matches ) {
+ return '<' . strtolower( $matches[1] );
+ }
+
function get_posts() {
global $wpdb;
}
// Clean up content
- $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
+ $post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content);
$post_content = str_replace('<br>', '<br />', $post_content);
$post_content = str_replace('<hr>', '<hr />', $post_content);
if ( is_wp_error( $post_id ) )
return $post_id;
if (!$post_id) {
- _e("Couldn't get post ID");
+ _e('Couldn’t get post ID');
return;
}