diff --git a/classes/class-wpcom-liveblog-entry.php b/classes/class-wpcom-liveblog-entry.php index dbea222d1..599ba59b5 100644 --- a/classes/class-wpcom-liveblog-entry.php +++ b/classes/class-wpcom-liveblog-entry.php @@ -192,10 +192,18 @@ public static function render_content( $content, $comment = false ) { */ public static function insert( $args ) { $args = apply_filters( 'liveblog_before_insert_entry', $args ); + + $args['user'] = self::handle_author_select( $args, false ); + $comment = self::insert_comment( $args ); if ( is_wp_error( $comment ) ) { return $comment; } + + if ( isset( $args['contributor_ids'] ) ) { + self::add_contributors( $comment->comment_ID, $args['contributor_ids'] ); + } + do_action( 'liveblog_insert_entry', $comment->comment_ID, $args['post_id'] ); $entry = self::from_comment( $comment ); return $entry; @@ -221,6 +229,12 @@ public static function update( $args ) { return $args['user']; } + $args['user'] = self::handle_author_select( $args, $args['entry_id'] ); + + if ( isset( $args['contributor_ids'] ) ) { + self::add_contributors( $args['entry_id'], $args['contributor_ids'] ); + } + $args = apply_filters( 'liveblog_before_update_entry', $args ); $comment = self::insert_comment( $args ); if ( is_wp_error( $comment ) ) {