diff --git a/includes/class-admin.php b/includes/class-admin.php index ba3b55b..525c7d8 100644 --- a/includes/class-admin.php +++ b/includes/class-admin.php @@ -15,6 +15,7 @@ class Admin { add_action( 'admin_init', array( '\Activitypub\Admin', 'register_settings' ) ); add_action( 'show_user_profile', array( '\Activitypub\Admin', 'add_fediverse_profile' ) ); } + /** * Add admin menu entry */ diff --git a/includes/rest/class-followers.php b/includes/rest/class-followers.php index 8826285..d543314 100644 --- a/includes/rest/class-followers.php +++ b/includes/rest/class-followers.php @@ -31,6 +31,13 @@ class Followers { ); } + /** + * Handle GET request + * + * @param WP_REST_Request $request + * + * @return WP_REST_Response + */ public static function get( $request ) { $user_id = $request->get_param( 'id' ); $user = get_user_by( 'ID', $user_id ); diff --git a/includes/rest/class-inbox.php b/includes/rest/class-inbox.php index 1083ff1..e65171b 100644 --- a/includes/rest/class-inbox.php +++ b/includes/rest/class-inbox.php @@ -21,6 +21,7 @@ class Inbox { //add_action( 'activitypub_inbox_announce', array( '\Activitypub\Rest\Inbox', 'handle_reaction' ), 10, 2 ); add_action( 'activitypub_inbox_create', array( '\Activitypub\Rest\Inbox', 'handle_create' ), 10, 2 ); } + /** * Register routes */ @@ -81,6 +82,7 @@ class Inbox { * Renders the user-inbox * * @param WP_REST_Request $request + * * @return WP_REST_Response */ public static function user_inbox( $request ) { diff --git a/includes/rest/class-nodeinfo.php b/includes/rest/class-nodeinfo.php index 179d1f3..aeb5d07 100644 --- a/includes/rest/class-nodeinfo.php +++ b/includes/rest/class-nodeinfo.php @@ -17,6 +17,7 @@ class Nodeinfo { add_filter( 'nodeinfo_data', array( '\Activitypub\Rest\Nodeinfo', 'add_nodeinfo_discovery' ), 10, 2 ); add_filter( 'nodeinfo2_data', array( '\Activitypub\Rest\Nodeinfo', 'add_nodeinfo2_discovery' ), 10 ); } + /** * Register routes */ diff --git a/includes/rest/class-outbox.php b/includes/rest/class-outbox.php index 06f4d56..4ce34d4 100644 --- a/includes/rest/class-outbox.php +++ b/includes/rest/class-outbox.php @@ -106,6 +106,11 @@ class Outbox { return $response; } + /** + * The supported parameters + * + * @return array list of parameters + */ public static function request_parameters() { $params = array(); @@ -121,6 +126,11 @@ class Outbox { return $params; } + /** + * Send "create" activities + * + * @param int $post_id + */ public static function send_post_activity( $post_id ) { $post = get_post( $post_id ); $user_id = $post->post_author; @@ -138,6 +148,11 @@ class Outbox { } } + /** + * Send "update" activities + * + * @param int $post_id + */ public static function send_update_activity( $post_id ) { $post = get_post( $post_id ); $user_id = $post->post_author; diff --git a/includes/rest/class-webfinger.php b/includes/rest/class-webfinger.php index e78b3eb..9005b44 100644 --- a/includes/rest/class-webfinger.php +++ b/includes/rest/class-webfinger.php @@ -16,6 +16,7 @@ class Webfinger { add_action( 'rest_api_init', array( '\Activitypub\Rest\Webfinger', 'register_routes' ) ); add_action( 'webfinger_user_data', array( '\Activitypub\Rest\Webfinger', 'add_webfinger_discovery' ), 10, 3 ); } + /** * Register routes */