Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis tristique tincidunt leo sit amet aliquet. Pellentesque cursus diam id nisi facilisis semper tempus lectus consequat. In elementum lacus id orci egestas ac fermentum odio viverra. Pellentesque elementum libero quis nisl rhoncus tempor. Phasellus nibh dolor, dictum id scelerisque quis, aliquam et lorem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam et dolor ligula. Maecenas nec urna justo. Mauris suscipit massa vel nisl malesuada sagittis. Sed rutrum quam blandit purus consectetur quis consectetur ligula sollicitudin. Maecenas eleifend quam vel risus euismod viverra. In elit enim, tincidunt eu ultrices a, feugiat non velit. Cras commodo nunc a neque sodales gravida.

Plugin used: FV Code Highlighter by Frank Verhoeven

{code type=php}
/**
* Create new post.
*
* @since 2.2.0
*/
function create_post() {
global $blog_id, $user_ID;
$this->get_accepted_content_type($this->atom_content_types);

$parser = new AtomParser();
if ( !$parser->parse() )
$this->client_error();

$entry = array_pop($parser->feed->entries);

log_app(‘Received entry:’, print_r($entry,true));

$catnames = array();
foreach ( $entry->categories as $cat ) {
array_push($catnames, $cat["term"]);
}

$wp_cats = get_categories(array(‘hide_empty’ => false));

$post_category = array();

foreach ( $wp_cats as $cat ) {
if ( in_array($cat->name, $catnames) )
array_push($post_category, $cat->term_id);
}

$publish = ! ( isset( $entry->draft ) && ‘yes’ == trim( $entry->draft ) );

$cap = ($publish) ? ‘publish_posts’ : ‘edit_posts’;
[...]
{/code}