| @@ -32,8 +32,12 @@ | ||
| 32 | 32 | * |
| 33 | 33 | * @return void |
| 34 | 34 | */ |
| 35 | 35 | public static function handle_create( $array, $user_id, $object = null ) { |
| 36 | + if ( ACTIVITYPUB_DISABLE_INCOMING_INTERACTIONS ) { | |
| 37 | + return; | |
| 38 | + } | |
| 39 | + | |
| 36 | 40 | if ( |
| 37 | 41 | ! isset( $array['object'] ) || |
| 38 | 42 | ! isset( $array['object']['id'] ) |
| 39 | 43 | ) { |
| @@ -56,9 +60,9 @@ | ||
| 56 | 60 | |
| 57 | 61 | $state = Interactions::add_comment( $array ); |
| 58 | 62 | $reaction = null; |
| 59 | 63 | |
| 60 | - if ( $state && ! \is_wp_error( $reaction ) ) { | |
| 64 | + if ( $state && ! \is_wp_error( $state ) ) { | |
| 61 | 65 | $reaction = \get_comment( $state ); |
| 62 | 66 | } |
| 63 | 67 | |
| 64 | 68 | \do_action( 'activitypub_handled_create', $array, $user_id, $state, $reaction ); |