Don't create an AP object if the comment object already exists

This commit is contained in:
Jeremy Dormitzer 2018-10-26 21:31:15 -04:00
parent 9453fd6299
commit 7b9f99112b

View File

@ -21,6 +21,13 @@ function handle_edit_comment( $comment_id ) {
}
function handle_transition_comment_status( $new_status, $old_status, $comment ) {
global $wpdb;
$existing = $wpdb->get_row( $wpdb->prepare(
"SELECT * FROM {$wpdb->prefix}pterotype_comments WHERE comment_id = %d", $comment->comment_ID
) );
if ( $existing ) {
return;
}
// This creates a new commenter actor if necessary
$actor_slug = get_comment_actor_slug( $comment );
$actor_outbox = get_rest_url(