modified file enshrined
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
namespace Activitypub\Model;
|
||||
|
||||
use Activitypub\Collection\Users;
|
||||
use Activitypub\Transformer\Post as Post_Transformer;
|
||||
use Activitypub\Transformer\Factory;
|
||||
|
||||
/**
|
||||
* ActivityPub Post Class
|
||||
@ -32,10 +32,14 @@ class Post {
|
||||
*/
|
||||
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed, VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
|
||||
public function __construct( $post, $post_author = null ) {
|
||||
_deprecated_function( __CLASS__, '1.0.0', '\Activitypub\Transformer\Post' );
|
||||
_deprecated_function( __METHOD__, '1.0.0', '\Activitypub\Transformer\Factory::get_transformer' );
|
||||
|
||||
$this->post = $post;
|
||||
$this->object = Post_Transformer::transform( $post )->to_object();
|
||||
$transformer = Factory::get_transformer( $post );
|
||||
|
||||
if ( ! \is_wp_error( $transformer ) ) {
|
||||
$this->post = $post;
|
||||
$this->object = $transformer->to_object();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user