Skip to content

Commit 62a6a0c

Browse files
authored
Move: Consistently use "moved_to" key (#1470)
1 parent c4c4981 commit 62a6a0c

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

includes/class-activitypub.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,17 @@ public static function register_user_meta() {
756756
)
757757
);
758758

759+
\register_meta(
760+
'user',
761+
$blog_prefix . 'activitypub_moved_to',
762+
array(
763+
'type' => 'string',
764+
'description' => 'The new URL of the user.',
765+
'single' => true,
766+
'sanitize_callback' => 'sanitize_url',
767+
)
768+
);
769+
759770
\register_meta(
760771
'user',
761772
$blog_prefix . 'activitypub_description',

includes/class-move.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static function account( $from, $to ) {
3333

3434
// Update the movedTo property.
3535
if ( $user->get__id() > 0 ) {
36-
\update_user_option( $user->get__id(), 'activitypub_move_to', $to );
36+
\update_user_option( $user->get__id(), 'activitypub_moved_to', $to );
3737
} else {
3838
\update_option( 'activitypub_blog_user_moved_to', $to );
3939
}

includes/model/class-user.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,6 @@ public function get_also_known_as() {
446446
* @return string The movedTo.
447447
*/
448448
public function get_moved_to() {
449-
return \get_user_option( 'activitypub_move_to', $this->_id );
449+
return \get_user_option( 'activitypub_moved_to', $this->_id );
450450
}
451451
}

0 commit comments

Comments
 (0)