Title: JSON API custom controller constuctor
Last modified: August 22, 2016

---

# JSON API custom controller constuctor

 *  [ClickOn GmbH](https://wordpress.org/support/users/mstonys/)
 * (@mstonys)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/json-api-custom-controller-constuctor/)
 * hello, i have to place some common code for each API method in my controller 
   constructor.. the problem that now JSON_API_XXX_Controller get’s listed as API
   method! how can i hide it and still use my constructor? thanks in advance!
 *     ```
       class JSON_API_XXX_Controller {
   
       public JSON_API_XXX_Controller(){
        //some code goes here for both foo and bar
       }
   
       public function foo(){}
   
       public function bar(){}
   
       }
       ```
   
 * [https://wordpress.org/plugins/json-api/](https://wordpress.org/plugins/json-api/)

The topic ‘JSON API custom controller constuctor’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/json-api.svg)
 * [JSON API](https://wordpress.org/plugins/json-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-api/)
 * [Active Topics](https://wordpress.org/support/plugin/json-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-api/reviews/)

## Tags

 * [basics](https://wordpress.org/support/topic-tag/basics/)
 * [controller](https://wordpress.org/support/topic-tag/controller/)

 * 0 replies
 * 1 participant
 * Last reply from: [ClickOn GmbH](https://wordpress.org/support/users/mstonys/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/json-api-custom-controller-constuctor/)
 * Status: not resolved