Skip to content

Commit ecd491f

Browse files
committed
Init actor from json
1 parent eff1922 commit ecd491f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

includes/collection/class-actors.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace Activitypub\Collection;
99

10+
use Activitypub\Activity\Actor;
1011
use WP_Error;
1112
use WP_User_Query;
1213
use Activitypub\Model\User;
@@ -350,11 +351,11 @@ public static function get_type_by_id( $user_id ) {
350351
* Returns the actor from cached data.
351352
*
352353
* @param string $cached_data The cached data.
353-
* @return User|Blog|Application The actor.
354+
* @return Cached_Actor|\WP_Error The actor or WP_Error if invalid data.
354355
*/
355356
public static function actor_from_cached_data( $cached_data ) {
356357
// Decode the cached data.
357-
$actor_data = \json_decode( $cached_data, true );
358+
$actor_data = Actor::init_from_json( $cached_data );
358359

359360
if ( ! $actor_data || ! is_array( $actor_data ) ) {
360361
return new \WP_Error(

0 commit comments

Comments
 (0)