public function publish_entry($id, $entry) { $post = new LiveBlogging_LiveBlogPost($id); $entry = new LiveBlogging_LiveBlogEntry($entry); $liveblogs = $post->get_liveblogs(); if (isset($_POST['live_blogging_entry_post'])) { $liveblogs[] = new LiveBlogging_LiveBlog($_POST['live_blogging_entry_post']); } $entries_to_submit = array(); foreach ($liveblogs as $liveblog) { $message_body = array('liveblog' => $liveblog->post_id(), 'id' => $id, 'type' => 'entry', 'html' => $entry->build_body()); $entries_to_submit[] = 'ADDMESSAGE ' . get_option('liveblogging_id') . '-liveblog-' . $liveblog->post_id() . ' ' . addslashes(json_encode($message_body)); } $this->run_meteor_command($entries_to_submit); }