PluginProbe
ActivityPub / 7.7.0
ActivityPub v7.7.0
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
← All changes | includes/scheduler/class-comment.php +4 -10 9.2.0 → 7.7.0 View file →
@@ -39,13 +39,13 @@
39 39 * @param string $old_status Old comment status.
40 40 * @param \WP_Comment $comment Comment object.
41 41 */
42 42 public static function schedule_comment_activity( $new_status, $old_status, $comment ) {
43 - if ( \defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {
43 + if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {
44 44 return;
45 45 }
46 46
47 - $comment = \get_comment( $comment );
47 + $comment = get_comment( $comment );
48 48
49 49 // Federate only comments that are written by a registered user.
50 50 if ( ! $comment || ! $comment->user_id ) {
51 51 return;
@@ -54,19 +54,13 @@
54 54 /*
55 55 * Check against supported comment types.
56 56 * Only federate registered ActivityPub comment types and standard WordPress comments.
57 57 */
58 - $comment_type = $comment->comment_type;
59 - if ( '' === $comment_type ) {
60 - // Be backwards compatible with comments that have an empty type by treating them as standard comments.
61 - $comment_type = 'comment';
62 - }
63 -
64 58 $allowed_types = Comment_Utils::get_comment_type_slugs();
65 59 $allowed_types[] = 'comment'; // Add core WordPress comment types.
66 60
67 61 // Check if comment type is in allowed list.
68 - if ( ! \in_array( $comment_type, $allowed_types, true ) ) {
62 + if ( ! in_array( $comment->comment_type, $allowed_types, true ) ) {
69 63 return;
70 64 }
71 65
72 66 $type = false;
@@ -77,9 +71,9 @@
77 71 ) {
78 72 $type = 'Create';
79 73 } elseif ( 'approved' === $new_status ) {
80 74 $type = 'Update';
81 - \update_comment_meta( $comment->comment_ID, 'activitypub_comment_modified', \time(), true );
75 + \update_comment_meta( $comment->comment_ID, 'activitypub_comment_modified', time(), true );
82 76 } elseif (
83 77 'trash' === $new_status ||
84 78 ( 'delete' === $new_status && '' === $old_status ) || // Went through schedule_comment_delete_activity().
85 79 'spam' === $new_status