echo '</div>';
}
+ function _normalize_tag( $matches ) {
+ return '<' . strtolower( $matches[1] );
+ }
+
function import_posts() {
global $wpdb, $current_user;
}
// Clean up content
- $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[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);
$post_content = $wpdb->escape($post_content);
return $post_id;
}
if (!$post_id) {
- _e("Couldn't get post ID");
+ _e('Couldn’t get post ID');
echo '</li>';
break;
}
$comment_content = $this->unhtmlentities($comment_content);
// Clean up content
- $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);
+ $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content);
$comment_content = str_replace('<br>', '<br />', $comment_content);
$comment_content = str_replace('<hr>', '<hr />', $comment_content);
$comment_content = $wpdb->escape($comment_content);
}
if ( $num_comments ) {
echo ' ';
- printf( __ngettext('%s comment', '%s comments', $num_comments), $num_comments );
+ printf( _n('%s comment', '%s comments', $num_comments), $num_comments );
}
echo '</li>';
flush();