PluginProbe
ActivityPub / 2.6.0
ActivityPub v2.6.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/handler/class-create.php +11 -2 1.3.02.6.0 View file →
@@ -14,9 +14,14 @@
14 14 /**
15 15 * Initialize the class, registering WordPress hooks
16 16 */
17 17 public static function init() {
18 - \add_action( 'activitypub_inbox_create', array( self::class, 'handle_create' ), 10, 3 );
18 + \add_action(
19 + 'activitypub_inbox_create',
20 + array( self::class, 'handle_create' ),
21 + 10,
22 + 3
23 + );
19 24 }
20 25
21 26 /**
22 27 * Handles "Create" requests
@@ -27,8 +32,12 @@
27 32 *
28 33 * @return void
29 34 */
30 35 public static function handle_create( $array, $user_id, $object = null ) {
36 + if ( ACTIVITYPUB_DISABLE_INCOMING_INTERACTIONS ) {
37 + return;
38 + }
39 +
31 40 if (
32 41 ! isset( $array['object'] ) ||
33 42 ! isset( $array['object']['id'] )
34 43 ) {
@@ -51,9 +60,9 @@
51 60
52 61 $state = Interactions::add_comment( $array );
53 62 $reaction = null;
54 63
55 - if ( $state && ! \is_wp_error( $reaction ) ) {
64 + if ( $state && ! \is_wp_error( $state ) ) {
56 65 $reaction = \get_comment( $state );
57 66 }
58 67
59 68 \do_action( 'activitypub_handled_create', $array, $user_id, $state, $reaction );