send blog-wide activities if enabled
This commit is contained in:
parent
1543c49c19
commit
3e969c859a
1 changed files with 36 additions and 13 deletions
|
@ -84,20 +84,43 @@ class Scheduler {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
\wp_schedule_single_event(
|
// send User activities
|
||||||
\time(),
|
if ( ! is_user_disabled( $activitypub_post->get_user_id() ) ) {
|
||||||
'activitypub_send_activity',
|
\wp_schedule_single_event(
|
||||||
array( $activitypub_post, $activity_type )
|
\time(),
|
||||||
);
|
'activitypub_send_activity',
|
||||||
|
array( $activitypub_post, $activity_type )
|
||||||
|
);
|
||||||
|
|
||||||
\wp_schedule_single_event(
|
\wp_schedule_single_event(
|
||||||
\time(),
|
\time(),
|
||||||
sprintf(
|
sprintf(
|
||||||
'activitypub_send_%s_activity',
|
'activitypub_send_%s_activity',
|
||||||
\strtolower( $activity_type )
|
\strtolower( $activity_type )
|
||||||
),
|
),
|
||||||
array( $activitypub_post )
|
array( $activitypub_post )
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// send Blog-User activities
|
||||||
|
if ( ! is_user_disabled( User_Factory::BLOG_USER_ID ) ) {
|
||||||
|
$activitypub_post->set_post_author( User_Factory::BLOG_USER_ID );
|
||||||
|
|
||||||
|
\wp_schedule_single_event(
|
||||||
|
\time(),
|
||||||
|
'activitypub_send_activity',
|
||||||
|
array( $activitypub_post, $activity_type )
|
||||||
|
);
|
||||||
|
|
||||||
|
\wp_schedule_single_event(
|
||||||
|
\time(),
|
||||||
|
sprintf(
|
||||||
|
'activitypub_send_%s_activity',
|
||||||
|
\strtolower( $activity_type )
|
||||||
|
),
|
||||||
|
array( $activitypub_post )
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue