Title: monkeypunch3's Replies | WordPress.org

---

# monkeypunch3

  [  ](https://wordpress.org/support/users/monkeypunch3/)

 *   [Profile](https://wordpress.org/support/users/monkeypunch3/)
 *   [Topics Started](https://wordpress.org/support/users/monkeypunch3/topics/)
 *   [Replies Created](https://wordpress.org/support/users/monkeypunch3/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/monkeypunch3/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/monkeypunch3/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/monkeypunch3/engagements/)
 *   [Favorites](https://wordpress.org/support/users/monkeypunch3/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 46 total)

1 [2](https://wordpress.org/support/users/monkeypunch3/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/monkeypunch3/replies/page/3/?output_format=md)
[4](https://wordpress.org/support/users/monkeypunch3/replies/page/4/?output_format=md)
[→](https://wordpress.org/support/users/monkeypunch3/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JSON API] CORS](https://wordpress.org/support/topic/cors-2/)
 *  [monkeypunch3](https://wordpress.org/support/users/monkeypunch3/)
 * (@monkeypunch3)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/cors-2/#post-9270920)
 * Looking at the JSON class there is an encode() function that sets the header 
   right in the function call.
 *     ```
           function encode($var)
           {
               header('Content-type: application/json');
               return $this->encodeUnsafe($var);
           }
       ```
   
 * If that works it might be possible to set a header right in your controller.
 *     ```
       class Seans_Controller {
   
       	public function hello_world() {
       		header("Access-Control-Allow-Origin: *");
       		return array(
       			"message" => "Hello, world"
       		);
       	}
       }
       ```
   
 * I just tried the above and it returned the header with the response.
    -  This reply was modified 9 years, 2 months ago by [monkeypunch3](https://wordpress.org/support/users/monkeypunch3/).
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Creating a search page](https://wordpress.org/support/topic/creating-a-search-page/)
 *  Thread Starter [monkeypunch3](https://wordpress.org/support/users/monkeypunch3/)
 * (@monkeypunch3)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/creating-a-search-page/#post-9270841)
 * Thanks. Unfortunately, WordPress.com does not let you add plugins unless you 
   purchase a business plan.
 * It looks like a simple search page isn’t possible.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Hashed IDs] Error after activation](https://wordpress.org/support/topic/error-after-activation-14/)
 *  Thread Starter [monkeypunch3](https://wordpress.org/support/users/monkeypunch3/)
 * (@monkeypunch3)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/error-after-activation-14/#post-8713028)
 * FYI I installed the plugin in a standard WP install and no error. In my current
   project will not use WP Network so I guess this is resolved for me.
 *   Forum: [Reviews](https://wordpress.org/support/forum/reviews/)
    In reply to:
   [[JSON API] WordPress needs to stop promoting this plugin](https://wordpress.org/support/topic/wordpress-needs-to-stop-promoting-this-plugin/)
 *  [monkeypunch3](https://wordpress.org/support/users/monkeypunch3/)
 * (@monkeypunch3)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/wordpress-needs-to-stop-promoting-this-plugin/#post-8061898)
 * I’ve made numerous improvements, wrote an article about how to use it and mentioned
   them to the author and did not receive a response. I’ve tried to contact him 
   about the license so that we can work on it and still no response.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JSON API] Couldn't get all custom fields](https://wordpress.org/support/topic/couldnt-get-all-custom-fields/)
 *  [monkeypunch3](https://wordpress.org/support/users/monkeypunch3/)
 * (@monkeypunch3)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/couldnt-get-all-custom-fields/#post-6932113)
 * For me, all the custom field data is coming back automatically.
 * In model/posts.php do you have this code:
 *     ```
       function set_custom_fields_value() {
           global $json_api;
           if ($json_api->include_value('custom_fields')) {
             $wp_custom_fields = get_post_custom($this->id);
             $this->custom_fields = new stdClass();
             if ($json_api->query->custom_fields) {
               $keys = explode(',', $json_api->query->custom_fields);
             }
             foreach ($wp_custom_fields as $key => $value) {
               if ($json_api->query->custom_fields) {
                 if (in_array($key, $keys)) {
                   $this->custom_fields->$key = $wp_custom_fields[$key];
                 }
               } else if (substr($key, 0, 1) != '_') {
                 $this->custom_fields->$key = $wp_custom_fields[$key];
               }
             }
           } else {
             unset($this->custom_fields);
           }
         }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JSON API] WP Multisite compatible ?](https://wordpress.org/support/topic/wp-multisite-compatible-3/)
 *  [monkeypunch3](https://wordpress.org/support/users/monkeypunch3/)
 * (@monkeypunch3)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/wp-multisite-compatible-3/#post-6911832)
 * Yes. I’m using it on one of my MU sites. I’ve added user management (with support
   for MU) and a few other features here, [https://github.com/monkeypunch3/JSON-API-Plus](https://github.com/monkeypunch3/JSON-API-Plus).
 * I have it setup as paths so [http://www.mysite.com/blog/usersite_1](http://www.mysite.com/blog/usersite_1),
   [http://www.mysite.com/blog/usersite_2](http://www.mysite.com/blog/usersite_2),
   etc.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JSON API] How to create new post as a page?](https://wordpress.org/support/topic/how-to-create-new-post-as-a-page/)
 *  Thread Starter [monkeypunch3](https://wordpress.org/support/users/monkeypunch3/)
 * (@monkeypunch3)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/how-to-create-new-post-as-a-page/#post-6741076)
 * From what I’ve read I just need to set the “type” to “page”…
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JSON API] Please don't let this AWESOME plugin die!](https://wordpress.org/support/topic/please-dont-let-this-awesome-plugin-die/)
 *  [monkeypunch3](https://wordpress.org/support/users/monkeypunch3/)
 * (@monkeypunch3)
 * [11 years ago](https://wordpress.org/support/topic/please-dont-let-this-awesome-plugin-die/#post-6371024)
 * Fantastic! I’ve made some modules for user management and uploading attachments
   here, [https://github.com/monkeypunch3/JSON-API-Plus](https://github.com/monkeypunch3/JSON-API-Plus).
   Please take them! I would love to see them in core.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JSON API] Gert rid off Shortcodes and html](https://wordpress.org/support/topic/gert-rid-off-shortcodes-and-html/)
 *  [monkeypunch3](https://wordpress.org/support/users/monkeypunch3/)
 * (@monkeypunch3)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/gert-rid-off-shortcodes-and-html/#post-6233027)
 * I’ve used WP Unformatted, [https://wordpress.org/support/topic/wp-unformatted-12-plugin?replies=6](https://wordpress.org/support/topic/wp-unformatted-12-plugin?replies=6).
 * I can’t find the exact link to the plugin. Once you have this installed then 
   you set sponge=1 and sandpaper=1 in the custom fields. It’s really hacky in my
   opinion and I might have even removed the plugin altogether. I can’t find it 
   now. I might have gave up because I’ve started to store all the data I was trying
   to keep unformatted in it’s own custom field. Anyway, hope that helps.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JSON API] Authentication For API Use](https://wordpress.org/support/topic/authentication-for-api-use/)
 *  [monkeypunch3](https://wordpress.org/support/users/monkeypunch3/)
 * (@monkeypunch3)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/authentication-for-api-use/#post-6231198)
 * There are already some actions that cannot be performed without being logged 
   into a valid user account. For example, you cannot edit or delete posts if you
   are not an authenticated user. But I think you can still get public WordPress
   content without logging in. There may be a way in WordPress to mark a post only
   available to logged in users. That should prevent the JSON API from returning
   that data. If not then it is a bug. Or if WordPress does not support that feature
   then you may need to add what you need to the core code base.
 * Take a look at the core code base and this project, [https://github.com/monkeypunch3/JSON-API-Plus](https://github.com/monkeypunch3/JSON-API-Plus).
   It will give you some ideas to adding your own authentication to different API
   calls. If you make any improvements please revert back.
 *   Forum: [Reviews](https://wordpress.org/support/forum/reviews/)
    In reply to:
   [[Really Simple Share] Interfers with other plugins](https://wordpress.org/support/topic/interfers-with-other-plugins/)
 *  [monkeypunch3](https://wordpress.org/support/users/monkeypunch3/)
 * (@monkeypunch3)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/interfers-with-other-plugins/#post-7846143)
 * I had this issue too. It was a while ago. This plugin interfered with the JSON
   API. I think I solved it but it might have been a related issue.
 * Pgsandstrom did you find an alternative?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JSON API] How to set defaults on new WP MU blogs?](https://wordpress.org/support/topic/how-to-set-defaults-on-new-wp-mu-blogs/)
 *  Thread Starter [monkeypunch3](https://wordpress.org/support/users/monkeypunch3/)
 * (@monkeypunch3)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/how-to-set-defaults-on-new-wp-mu-blogs/#post-4620527)
 * I found one way to do it by using the JSON_API_CONTROLLERS global variable as
   mentioned here, [http://wordpress.org/plugins/json-api/other_notes/#5.3.-Configuration-options](http://wordpress.org/plugins/json-api/other_notes/#5.3.-Configuration-options).
 * JSON_API_CONTROLLERS – a comma-separated list of default controllers to enable(
   this is overridden by the JSON API settings page)
 * However this isn’t reflected in the settings page. What I mean is that if I view
   the settings page it doesn’t show the controllers as activated. This may be a
   bug.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JSON API] Remove unnecessary fields from json response](https://wordpress.org/support/topic/remove-unnecessary-fields-from-json-response/)
 *  [monkeypunch3](https://wordpress.org/support/users/monkeypunch3/)
 * (@monkeypunch3)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/remove-unnecessary-fields-from-json-response/#post-4624568)
 * Have you seen the exclude and include options? [https://wordpress.org/plugins/json-api/other_notes/#3.3.-Using-include/exclude-and-redirects](https://wordpress.org/plugins/json-api/other_notes/#3.3.-Using-include/exclude-and-redirects)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JSON API] Response too slow](https://wordpress.org/support/topic/response-too-slow/)
 *  [monkeypunch3](https://wordpress.org/support/users/monkeypunch3/)
 * (@monkeypunch3)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/response-too-slow/#post-4613452)
 * This happens to me every once in a while. Sometimes it’s just one call that’s
   slow. I don’t know what it is but after maybe half an hour it picks back up. 
   I haven’t figured it out.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[JSON API] How to login, register and logout user?](https://wordpress.org/support/topic/how-to-login-register-and-logout-user/)
 *  Thread Starter [monkeypunch3](https://wordpress.org/support/users/monkeypunch3/)
 * (@monkeypunch3)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/how-to-login-register-and-logout-user/#post-4470916)
 * Grasshopper, to really understand how to use this library you need to understand
   HTTP protocol.
 * [http://www.google.com/search?q=what+is+the+difference+between+post+and+get](http://www.google.com/search?q=what+is+the+difference+between+post+and+get)
 * Your browser can submit GET requests through the URL address bar but not POST
   requests. You have to create a form to do that and set it to post.
 * [http://www.programmerinterview.com/index.php/general-miscellaneous/html-get-vs-post/](http://www.programmerinterview.com/index.php/general-miscellaneous/html-get-vs-post/)

Viewing 15 replies - 1 through 15 (of 46 total)

1 [2](https://wordpress.org/support/users/monkeypunch3/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/monkeypunch3/replies/page/3/?output_format=md)
[4](https://wordpress.org/support/users/monkeypunch3/replies/page/4/?output_format=md)
[→](https://wordpress.org/support/users/monkeypunch3/replies/page/2/?output_format=md)