PluginProbe
ActivityPub / 7.8.0
ActivityPub v7.8.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
activitypub / includes / transformer / class-user.php

class-user.php in ActivityPub 7.8.0, at includes/transformer/class-user.php

36 lines 677 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * User Transformer Class file.
4 *
5 * @package Activitypub
6 */
7
8 namespace Activitypub\Transformer;
9
10 use Activitypub\Collection\Actors;
11
12 /**
13 * User Transformer Class.
14 */
15 class User extends Base {
16 /**
17 * Transforms the WP_User object to an Actor.
18 *
19 * @see \Activitypub\Activity\Actor
20 *
21 * @return \Activitypub\Activity\Base_Object|\WP_Error The Actor or WP_Error on failure.
22 */
23 public function to_object() {
24 return $this->transform_object_properties( Actors::get_by_id( $this->item->ID ) );
25 }
26
27 /**
28 * Get the Actor ID.
29 *
30 * @return string The Actor ID.
31 */
32 public function to_id() {
33 return Actors::get_by_id( $this->item->ID )->get_id();
34 }
35 }
36