diff --git a/includes/class-activity-dispatcher.php b/includes/class-activity-dispatcher.php index 617162d..cc78b2d 100644 --- a/includes/class-activity-dispatcher.php +++ b/includes/class-activity-dispatcher.php @@ -65,7 +65,7 @@ class Activity_Dispatcher { return; } - $transformer = \Activitypub\Transformer\Transformers_Manager::instance()->get_transformer( $wp_post ); + $transformer = Transformers_Manager::instance()->get_transformer( $wp_post ); $object = $transformer->to_object(); $activity = new Activity(); @@ -102,7 +102,7 @@ class Activity_Dispatcher { return; } - $transformer = \Activitypub\Transformer\Transformers_Manager::instance()->get_transformer( $wp_post ); + $transformer = Transformers_Manager::instance()->get_transformer( $wp_post ); $object = $transformer->to_object(); $activity = new Activity(); diff --git a/includes/model/class-post.php b/includes/model/class-post.php index 6aeea14..72f95d4 100644 --- a/includes/model/class-post.php +++ b/includes/model/class-post.php @@ -33,8 +33,9 @@ class Post { public function __construct( $post, $post_author = null ) { _deprecated_function( __CLASS__, '1.0.0', '\Activitypub\Transformer\Post' ); - $this->post = $post; - $this->object = Transformer_Post->set_wp_post( $post )->to_object(); + $this->post = $post; + $transformer = new Transformer_Post(); + $this->object = $transformer->set_wp_post( $post )->to_object(); } /**