From 8e283ac652276c1bbdf8ce51ccb086e6bb729726 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Wed, 29 Aug 2018 16:47:56 -0400 Subject: [PATCH] Rename handle->actor --- inc/api.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inc/api.php b/inc/api.php index 2b59485..4d42dec 100644 --- a/inc/api.php +++ b/inc/api.php @@ -7,13 +7,13 @@ require_once plugin_dir_path( __FILE__ ) . '/objects.php'; require_once plugin_dir_path( __FILE__ ) . '/activities.php'; function get_actor( $request ) { - $actor = $request['handle']; + $actor = $request['actor']; $user = get_user_by( 'slug', $actor ); return \actors\get_actor( $user ); } function post_to_outbox( $request ) { - $actor = $request['handle'] ; + $actor = $request['actor']; $activity = json_decode( $request->get_body() ); return \outbox\handle_activity( $actor, $activity ); } @@ -29,11 +29,11 @@ function get_activity( $request ) { } function register_routes() { - register_rest_route( 'activitypub/v1', '/actor/(?P[a-zA-Z0-9-]+)', array( + register_rest_route( 'activitypub/v1', '/actor/(?P[a-zA-Z0-9-]+)', array( 'methods' => 'GET', 'callback' => __NAMESPACE__ . '\get_actor', ) ); - register_rest_route( 'activitypub/v1', '/actor/(?P[a-zA-Z0-9-]+)/outbox', array( + register_rest_route( 'activitypub/v1', '/actor/(?P[a-zA-Z0-9-]+)/outbox', array( 'methods' => 'POST', 'callback' => __NAMESPACE__ . '\post_to_outbox', ) );