Skip to content

Commit

Permalink
Merge pull request #416 from paulschreiber/fix/contributor-ids
Browse files Browse the repository at this point in the history
Restore insertion/update of contributors
  • Loading branch information
philipjohn authored Apr 27, 2018
2 parents 669f2a5 + 40a2cff commit 09d4d89
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions classes/class-wpcom-liveblog-entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 ) ) {
Expand Down

0 comments on commit 09d4d89

Please sign in to comment.