PluginProbe
ActivityPub / 3.2.5
ActivityPub v3.2.5
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/class-notification.php +10 -34 8.2.13.2.5 View file →
@@ -1,17 +1,10 @@
1 1 <?php
2 -/**
3 - * Notification file.
4 - *
5 - * @package Activitypub
6 - */
7 2
8 3 namespace Activitypub;
9 4
10 5 /**
11 6 * Notification class.
12 - *
13 - * @deprecated 7.5.0 Use action hooks like 'activitypub_handled_{type}' instead.
14 7 */
15 8 class Notification {
16 9 /**
17 10 * The type of the notification.
@@ -43,19 +36,17 @@
43 36
44 37 /**
45 38 * Notification constructor.
46 39 *
47 - * @param string $type The type of the notification.
48 - * @param string $actor The actor URL.
49 - * @param array $activity The Activity object.
50 - * @param int $target The WordPress User-Id.
40 + * @param string $type The type of the notification.
41 + * @param string $actor The actor URL.
42 + * @param array $object The Activity object.
43 + * @param int $target The WordPress User-Id.
51 44 */
52 - public function __construct( $type, $actor, $activity, $target ) {
53 - \_deprecated_class( __CLASS__, '7.5.0', 'Use action hooks like "activitypub_handled_{type}" instead.' );
54 -
55 - $this->type = $type;
56 - $this->actor = $actor;
57 - $this->object = $activity;
45 + public function __construct( $type, $actor, $object, $target ) { // phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames.objectFound
46 + $this->type = $type;
47 + $this->actor = $actor;
48 + $this->object = $object;
58 49 $this->target = $target;
59 50 }
60 51
61 52 /**
@@ -63,23 +54,8 @@
63 54 */
64 55 public function send() {
65 56 $type = \strtolower( $this->type );
66 57
67 - /**
68 - * Action to send ActivityPub notifications.
69 - *
70 - * @deprecated 7.5.0 Use "activitypub_handled_{$type}" instead.
71 - *
72 - * @param Notification $instance The notification object.
73 - */
74 - \do_action_deprecated( 'activitypub_notification', array( $this ), '7.5.0', "activitypub_handled_{$type}" );
75 -
76 - /**
77 - * Type-specific action to send ActivityPub notifications.
78 - *
79 - * @deprecated 7.5.0 Use "activitypub_handled_{$type}" instead.
80 - *
81 - * @param Notification $instance The notification object.
82 - */
83 - \do_action_deprecated( "activitypub_notification_{$type}", array( $this ), '7.5.0', "activitypub_handled_{$type}" );
58 + do_action( 'activitypub_notification', $this );
59 + do_action( "activitypub_notification_{$type}", $this );
84 60 }
85 61 }