From 40a2cffa51b41b3df200d9f4c5bc8a0f0fd484a6 Mon Sep 17 00:00:00 2001 From: Paul Schreiber Date: Thu, 26 Apr 2018 17:57:38 -0400 Subject: [PATCH] restore contributor_id support to insert() and update() --- classes/class-wpcom-liveblog-entry.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/classes/class-wpcom-liveblog-entry.php b/classes/class-wpcom-liveblog-entry.php index 4afb55b5d..8eadad70b 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 ) ) {