Skip to content

Commit 10a8a2d

Browse files
committed
use unique meta
1 parent 6878b86 commit 10a8a2d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

includes/class-activitypub.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public static function init() {
2424
}
2525

2626
\add_action( 'transition_post_status', array( '\Activitypub\Activitypub', 'schedule_post_activity' ), 10, 3 );
27-
\add_action( 'wp_trash_post', array( '\Activitypub\Activitypub', 'trash_post' ), 10 );
28-
\add_action( 'untrash_post', array( '\Activitypub\Activitypub', 'untrash_post' ), 10 );
27+
\add_action( 'wp_trash_post', array( '\Activitypub\Activitypub', 'trash_post' ), 1 );
28+
\add_action( 'untrash_post', array( '\Activitypub\Activitypub', 'untrash_post' ), 1 );
2929
}
3030

3131
/**
@@ -196,7 +196,7 @@ public static function get_avatar_url( $comment ) {
196196
* @return void
197197
*/
198198
public static function trash_post( $post_id ) {
199-
\add_post_meta( $post_id, 'activitypub_canonical_url', \get_permalink( $post_id ) );
199+
\add_post_meta( $post_id, 'activitypub_canonical_url', \get_permalink( $post_id ), true );
200200
}
201201

202202
/**

tests/test-class-activitypub-post.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ public function test_to_array() {
1616

1717
\wp_trash_post( $post );
1818

19-
$post = \get_post( $post );
20-
2119
$activitypub_post = new \Activitypub\Model\Post( $post );
2220

2321
$this->assertEquals( $permalink, $activitypub_post->get_id() );

0 commit comments

Comments
 (0)