Solved – How to Create Custom Endpoint Route?
I’m a little stuck on the documentation, how would I go about creating a new route for say…. adding reactions to an activity field?
I started playing around with building it but became confused as to how to actually execute a reaction on an activity
bp_rest_register_field( 'activity', 'reactions', array( 'get_callback' => 'get_additional_field', 'update_callback' => 'update_additional_field', 'schema' => array( 'description' => 'Reactions on Activity', 'enum' => array('HAPPY', 'LOVES', 'DISLIKES','FUNNY', 'WOW', 'ANGRY', 'SAD'), 'type' => 'string', 'context' => array( 'view', 'edit' ), ), ) );
- You must be logged in to reply to this topic.