use unique meta

This commit is contained in:
Matthias Pfefferle 2022-12-27 16:01:59 +01:00
parent 6878b86922
commit 10a8a2de1d
2 changed files with 3 additions and 5 deletions

View file

@ -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 );
}
/**

View file

@ -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() );