Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/changelog/1526-from-description
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Importing attachments no longer creates Outbox items for them.
6 changes: 5 additions & 1 deletion includes/scheduler/class-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,17 @@ public static function schedule_post_activity( $post_id, $post, $update, $post_b
* @param int $post_id Attachment ID.
*/
public static function transition_attachment_status( $post_id ) {
if ( \defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {
return;
}

if ( ! \post_type_supports( 'attachment', 'activitypub' ) ) {
return;
}

$post = \get_post( $post_id );

switch ( current_action() ) {
switch ( \current_action() ) {
case 'add_attachment':
// Add the post to the outbox.
add_to_outbox( $post, 'Create', $post->post_author );
Expand Down
Loading