fix init of new transformer instance

This commit is contained in:
André Menrath 2023-11-25 10:37:00 +01:00
commit 9c20c8fced
2 changed files with 5 additions and 4 deletions

View file

@ -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();

View file

@ -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();
}
/**