updated plugin Event Bridge for ActivityPub version 1.3.0
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
namespace Event_Bridge_For_ActivityPub;
|
||||
|
||||
// Exit if accessed directly.
|
||||
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
|
||||
\defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
|
||||
|
||||
use Activitypub\Transformer\Factory as Transformer_Factory;
|
||||
use Event_Bridge_For_ActivityPub\Setup;
|
||||
@ -21,7 +21,7 @@ use DateTime;
|
||||
use WP_Post;
|
||||
|
||||
use function ActivityPub\add_to_outbox;
|
||||
use function Activitypub\is_user_disabled;
|
||||
use function Activitypub\user_can_activitypub;
|
||||
|
||||
/**
|
||||
* Adds automatic announcing or sending of reminders before the events start time.
|
||||
@ -71,7 +71,7 @@ class Reminder {
|
||||
// Check for our supported post types.
|
||||
$current_screen = \get_current_screen();
|
||||
$event_post_types = Setup::get_instance()->get_active_event_plugins_post_types();
|
||||
if ( ! $current_screen || ! in_array( $current_screen->post_type, $event_post_types, true ) ) {
|
||||
if ( ! $current_screen || ! \in_array( $current_screen->post_type, $event_post_types, true ) ) {
|
||||
return;
|
||||
}
|
||||
$asset_data = include EVENT_BRIDGE_FOR_ACTIVITYPUB_PLUGIN_DIR . 'build/reminder/plugin.asset.php';
|
||||
@ -91,11 +91,11 @@ class Reminder {
|
||||
/**
|
||||
* Schedule Activities.
|
||||
*
|
||||
* @param string $new_status New post status.
|
||||
* @param string $old_status Old post status.
|
||||
* @param ?WP_Post $post Post object.
|
||||
* @param string $new_status New post status.
|
||||
* @param string $old_status Old post status.
|
||||
* @param WP_Post|null $post Post object.
|
||||
*/
|
||||
public static function maybe_schedule_event_reminder( $new_status, $old_status, $post ): void {
|
||||
public static function maybe_schedule_event_reminder( string $new_status, string $old_status, WP_Post|null $post ): void {
|
||||
if ( ! $post instanceof WP_Post ) {
|
||||
return;
|
||||
}
|
||||
@ -170,7 +170,7 @@ class Reminder {
|
||||
*
|
||||
* @param int $post_id The WordPress post ID of the event post.
|
||||
*/
|
||||
public static function send_event_reminder( $post_id ) {
|
||||
public static function send_event_reminder( int $post_id ): void {
|
||||
$post = \get_post( $post_id );
|
||||
|
||||
$transformer = Transformer_Factory::get_transformer( $post );
|
||||
@ -182,7 +182,7 @@ class Reminder {
|
||||
$actor = $transformer->get_actor_object();
|
||||
$user_id = $actor->get__id();
|
||||
|
||||
if ( $user_id > 0 && is_user_disabled( $user_id ) ) {
|
||||
if ( $user_id > 0 && ! user_can_activitypub( $user_id ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user