Forum Replies Created

Viewing 1 replies (of 1 total)
  • michael.faeth

    (@michaelfaeth)

    try

    class My_Theme_Json_Api {
    
        public function __construct() {
            add_filter('json_api_encode', array( $this, 'json_api_encode') );
        }
    
        public function json_api_encode( $data ) {
    
            if (isset($_GET['exclude_fields'])) {
                // ... parse and unset fields here...
            }
    
            return $data;
        }
    }
    
    new My_Theme_Json_Api();
Viewing 1 replies (of 1 total)