will be released with the next version
This commit is contained in:
Matthias Pfefferle 2019-02-24 12:27:49 +01:00
parent 4d07955c75
commit 1828c88d73

View file

@ -91,6 +91,11 @@ class Activitypub {
* @param int $post_id * @param int $post_id
*/ */
public static function schedule_post_activity( $new_status, $old_status, $post ) { public static function schedule_post_activity( $new_status, $old_status, $post ) {
// do not send activities if post is password protected
if ( post_password_required( $post ) ) {
return;
}
if ( 'publish' === $new_status && 'publish' !== $old_status ) { if ( 'publish' === $new_status && 'publish' !== $old_status ) {
wp_schedule_single_event( time() + wp_rand( 0, 120 ), 'activitypub_send_post_activity', array( $post->ID ) ); wp_schedule_single_event( time() + wp_rand( 0, 120 ), 'activitypub_send_post_activity', array( $post->ID ) );
} elseif ( 'publish' === $new_status ) { } elseif ( 'publish' === $new_status ) {