This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Registers a REST field for the Activity Endpoints. | |
function example_register_activity_rest_field() { | |
bp_rest_register_field( | |
'activity', // Id of the BuddyPress component the REST field is about | |
'example_field', // Used into the REST response/request | |
array( | |
'get_callback' => 'example_get_rest_field_callback', // The function to use to get the value of the REST Field | |
'update_callback' => 'example_update_rest_field_callback', // The function to use to update the value of the REST Field |