updated plugin ActivityPub version 2.4.0

This commit is contained in:
2024-06-27 12:10:38 +00:00
committed by Gitium
parent eeef5ad6e0
commit 4e493c268e
49 changed files with 1368 additions and 491 deletions

View File

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