diff --git a/includes/class-activitypub.php b/includes/class-activitypub.php index 3ff7d13..658f72c 100644 --- a/includes/class-activitypub.php +++ b/includes/class-activitypub.php @@ -24,8 +24,8 @@ class Activitypub { } \add_action( 'transition_post_status', array( '\Activitypub\Activitypub', 'schedule_post_activity' ), 10, 3 ); - \add_action( 'wp_trash_post', array( '\Activitypub\Activitypub', 'trash_post' ), 10 ); - \add_action( 'untrash_post', array( '\Activitypub\Activitypub', 'untrash_post' ), 10 ); + \add_action( 'wp_trash_post', array( '\Activitypub\Activitypub', 'trash_post' ), 1 ); + \add_action( 'untrash_post', array( '\Activitypub\Activitypub', 'untrash_post' ), 1 ); } /** @@ -196,7 +196,7 @@ class Activitypub { * @return void */ public static function trash_post( $post_id ) { - \add_post_meta( $post_id, 'activitypub_canonical_url', \get_permalink( $post_id ) ); + \add_post_meta( $post_id, 'activitypub_canonical_url', \get_permalink( $post_id ), true ); } /** diff --git a/tests/test-class-activitypub-post.php b/tests/test-class-activitypub-post.php index 08e0bfd..4f1c74e 100644 --- a/tests/test-class-activitypub-post.php +++ b/tests/test-class-activitypub-post.php @@ -16,8 +16,6 @@ class Test_Activitypub_Post extends WP_UnitTestCase { \wp_trash_post( $post ); - $post = \get_post( $post ); - $activitypub_post = new \Activitypub\Model\Post( $post ); $this->assertEquals( $permalink, $activitypub_post->get_id() );