@@ -21,7 +21,7 @@ class Blocked_Actors {
2121 * @param string $value The actor URI to block.
2222 * @return bool True on success, false on failure.
2323 */
24- public static function add_block ( $ user_id , $ value ) {
24+ public static function add ( $ user_id , $ value ) {
2525 // Find or create actor post.
2626 $ actor_post = Remote_Actors::fetch_by_uri ( $ value );
2727 if ( \is_wp_error ( $ actor_post ) ) {
@@ -55,7 +55,7 @@ public static function add_block( $user_id, $value ) {
5555 * @param string|int $value The actor URI or post ID to unblock.
5656 * @return bool True on success, false on failure.
5757 */
58- public static function remove_block ( $ user_id , $ value ) {
58+ public static function remove ( $ user_id , $ value ) {
5959 // Handle both post ID and URI formats.
6060 if ( \is_numeric ( $ value ) ) {
6161 $ post_id = (int ) $ value ;
@@ -84,7 +84,7 @@ public static function remove_block( $user_id, $value ) {
8484 }
8585
8686 /**
87- * Get the blocked actors of a given user, along with a total count for pagination purposes .
87+ * Query blocked actors of a given user, with pagination info .
8888 *
8989 * @param int|null $user_id The ID of the WordPress User.
9090 * @param int $number Maximum number of results to return.
@@ -98,7 +98,7 @@ public static function remove_block( $user_id, $value ) {
9898 * @type int $total Total number of blocked actors.
9999 * }
100100 */
101- public static function get_blocked_actors_with_count ( $ user_id , $ number = -1 , $ page = null , $ args = array () ) {
101+ public static function query ( $ user_id , $ number = -1 , $ page = null , $ args = array () ) {
102102 $ defaults = array (
103103 'post_type ' => Remote_Actors::POST_TYPE ,
104104 'posts_per_page ' => $ number ,
@@ -122,9 +122,78 @@ public static function get_blocked_actors_with_count( $user_id, $number = -1, $p
122122 return \compact ( 'blocked_actors ' , 'total ' );
123123 }
124124
125+ /**
126+ * Get many blocked actors.
127+ *
128+ * @param int|null $user_id The ID of the WordPress User.
129+ * @param int $number Maximum number of results to return.
130+ * @param int $page Page number.
131+ * @param array $args The WP_Query arguments.
132+ *
133+ * @return \WP_Post[] List of blocked Actors.
134+ */
135+ public static function get_many ( $ user_id , $ number = -1 , $ page = null , $ args = array () ) {
136+ return self ::query ( $ user_id , $ number , $ page , $ args )['blocked_actors ' ];
137+ }
138+
139+ /**
140+ * Add an actor block for a user.
141+ *
142+ * @deprecated unreleased Use {@see Blocked_Actors::add()}.
143+ *
144+ * @param int $user_id The user ID.
145+ * @param string $value The actor URI to block.
146+ * @return bool True on success, false on failure.
147+ */
148+ public static function add_block ( $ user_id , $ value ) {
149+ \_deprecated_function ( __METHOD__ , 'unreleased ' , 'Activitypub\Collection\Blocked_Actors::add ' );
150+
151+ return self ::add ( $ user_id , $ value );
152+ }
153+
154+ /**
155+ * Remove an actor block for a user.
156+ *
157+ * @deprecated unreleased Use {@see Blocked_Actors::remove()}.
158+ *
159+ * @param int $user_id The user ID.
160+ * @param string|int $value The actor URI or post ID to unblock.
161+ * @return bool True on success, false on failure.
162+ */
163+ public static function remove_block ( $ user_id , $ value ) {
164+ \_deprecated_function ( __METHOD__ , 'unreleased ' , 'Activitypub\Collection\Blocked_Actors::remove ' );
165+
166+ return self ::remove ( $ user_id , $ value );
167+ }
168+
169+ /**
170+ * Get the blocked actors of a given user, along with a total count for pagination purposes.
171+ *
172+ * @deprecated unreleased Use {@see Blocked_Actors::query()}.
173+ *
174+ * @param int|null $user_id The ID of the WordPress User.
175+ * @param int $number Maximum number of results to return.
176+ * @param int $page Page number.
177+ * @param array $args The WP_Query arguments.
178+ *
179+ * @return array {
180+ * Data about the blocked actors.
181+ *
182+ * @type \WP_Post[] $blocked_actors List of blocked Actor WP_Post objects.
183+ * @type int $total Total number of blocked actors.
184+ * }
185+ */
186+ public static function get_blocked_actors_with_count ( $ user_id , $ number = -1 , $ page = null , $ args = array () ) {
187+ \_deprecated_function ( __METHOD__ , 'unreleased ' , 'Activitypub\Collection\Blocked_Actors::query ' );
188+
189+ return self ::query ( $ user_id , $ number , $ page , $ args );
190+ }
191+
125192 /**
126193 * Get the blocked actors of a given user.
127194 *
195+ * @deprecated unreleased Use {@see Blocked_Actors::get_many()}.
196+ *
128197 * @param int|null $user_id The ID of the WordPress User.
129198 * @param int $number Maximum number of results to return.
130199 * @param int $page Page number.
@@ -133,6 +202,8 @@ public static function get_blocked_actors_with_count( $user_id, $number = -1, $p
133202 * @return \WP_Post[] List of blocked Actors.
134203 */
135204 public static function get_blocked_actors ( $ user_id , $ number = -1 , $ page = null , $ args = array () ) {
136- return self ::get_blocked_actors_with_count ( $ user_id , $ number , $ page , $ args )['blocked_actors ' ];
205+ \_deprecated_function ( __METHOD__ , 'unreleased ' , 'Activitypub\Collection\Blocked_Actors::get_many ' );
206+
207+ return self ::get_many ( $ user_id , $ number , $ page , $ args );
137208 }
138209}
0 commit comments