Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How to add custom data to Discussion API

I read this
I want add more data to API result, such as 'body_excerpt'. How to inject custom data into API result?


  • Options
    R_JR_J Ex-Fanboy Munich Admin

    Man, thanks for that question - it made me learn something new! But the answer to your question is quite conventional: you need a custom plugin for that.
    It doesn't have to be complicated, though. It only needs to have one one method:

        public function discussionsApiController_getOutput_handler($result) {
            $result['body_excerpt'] = Gdn_Format::excerpt(
            return $result;
Sign In or Register to comment.