updated plugin ActivityPub version 2.6.1

This commit is contained in:
2024-07-19 19:46:05 +00:00
committed by Gitium
parent 19e351ef3b
commit 3b4e169a1e
39 changed files with 718 additions and 143 deletions

View File

@ -117,6 +117,11 @@ class Scheduler {
public static function schedule_post_activity( $new_status, $old_status, $post ) {
$post = get_post( $post );
if ( 'ap_extrafield' === $post->post_type ) {
self::schedule_profile_update( $post->post_author );
return;
}
// Do not send activities if post is password protected.
if ( \post_password_required( $post ) ) {
return;
@ -130,9 +135,16 @@ class Scheduler {
$type = false;
if ( 'publish' === $new_status && 'publish' !== $old_status ) {
if (
'publish' === $new_status &&
'publish' !== $old_status
) {
$type = 'Create';
} elseif ( 'publish' === $new_status ) {
} elseif (
'publish' === $new_status ||
( 'draft' === $new_status &&
'draft' !== $old_status )
) {
$type = 'Update';
} elseif ( 'trash' === $new_status ) {
$type = 'Delete';
@ -311,7 +323,9 @@ class Scheduler {
/**
* Theme mods only have a dynamic filter so we fudge it like this.
* @param mixed $value
*
* @param mixed $value
*
* @return mixed
*/
public static function blog_user_update( $value = null ) {
@ -321,6 +335,7 @@ class Scheduler {
/**
* Send a profile update to all followers. Gets hooked into all relevant options/meta etc.
*
* @param int $user_id The user ID to update (Could be 0 for Blog-User).
*/
public static function schedule_profile_update( $user_id ) {