Title: Custom Type Raw
Last modified: August 20, 2016

---

# Custom Type Raw

 *  [Cory Lamle](https://wordpress.org/support/users/corylamleorg/)
 * (@corylamleorg)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/custom-type-raw/)
 * I just updated to types 1.2 and the types raw seems to not work anymore. It actually
   calls the WPCF_Field->html function every-time even though I pass the data as
   such:
 * types_render_field(“my-field”, array(“raw” => “true”))
 * The html functions calls do_shortcut which cause issues if your trying to get
   the data raw…
 * Has anyone else seen this issue? Is this new desired behavior? How can I get 
   the data truly raw without having do_shortcut process the results?
 * Thanks!
 * [http://wordpress.org/extend/plugins/types/](http://wordpress.org/extend/plugins/types/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [Cory Lamle](https://wordpress.org/support/users/corylamleorg/)
 * (@corylamleorg)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/custom-type-raw/#post-3568493)
 * So my custom fix to get this back working the way it did pre version 1.2 was 
   to add the following lines to frontend.php at the bottom of the
    types_render_field
   method:
 *     ```
       // API filter
       $wpcf->field->set( $post, $field );
       if ( isset( $params['raw'] ) && $params['raw'] == 'true' ) {
       	return $html;
       } else {
       	return $wpcf->field->html( $html );
       }
       ```
   
 *  Thread Starter [Cory Lamle](https://wordpress.org/support/users/corylamleorg/)
 * (@corylamleorg)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/custom-type-raw/#post-3568499)
 * Here is another fix if your trying to store numeric values of zero. Before 1.2
   I was able to store numeric types of “0”. Since the upgrade this is not possible
   since the empty function will by-pass “0”.
 * OPEN FILE:
    embedded/classes/field.php
 * SEE METHOD:
    WPCF_Field->save
 * UPDATE:
    if ( !empty( $value ) ) { TO: if ( !empty( $value ) || is_numeric($value))
 * Hope this helps others!
 *  [jozik](https://wordpress.org/support/users/jozik/)
 * (@jozik)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/custom-type-raw/#post-3568509)
 * You’re right, some part of code is reviewed and not working same as before.
 * 1. We enabled do_shortcode support when ‘raw’ is TRUE. Do you think it should
   be enabled only for WYSIWYG ield type in RAW mode?
 * 2. Do you suggest to allow writing 0 value for Numeric field?
 *  Thread Starter [Cory Lamle](https://wordpress.org/support/users/corylamleorg/)
 * (@corylamleorg)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/custom-type-raw/#post-3568525)
 * Hi Srdjan,
 * Thanks for getting back…
 * 1. I think raw should really mean raw it should have no other processing added
   to it. By pre-processing it with other filters and functions it really isn’t 
   raw. When I think of raw from the DB I should get back pretty much what I would
   get from a SELECT statement and nothing else…
 * 2. Zero by definition is a “Whole Number” so it should be included in any numeric
   definition.
 * I think by bringing back the pre 1.2 changes the definitions of your API will
   be much more accurate, right now they will lead to further help-desk tickets 
   in the future. I also know with every update that is released that I will have
   to go back and update these files as this is how I have already built out a rather
   large site using Types…
 * Cheers!
 *  [jozik](https://wordpress.org/support/users/jozik/)
 * (@jozik)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/custom-type-raw/#post-3568578)
 * Fixes are added for next release for both issues.
    Thanks.
 *  Thread Starter [Cory Lamle](https://wordpress.org/support/users/corylamleorg/)
 * (@corylamleorg)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/custom-type-raw/#post-3568579)
 * Awesome! Looking forward to it…
 * Thanks Srdjan!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Custom Type Raw’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/types_ced1d3.svg)
 * [Toolset Types - Custom Post Types, Custom Fields and Taxonomies](https://wordpress.org/plugins/types/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/types/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/types/)
 * [Active Topics](https://wordpress.org/support/plugin/types/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/types/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/types/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Cory Lamle](https://wordpress.org/support/users/corylamleorg/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/custom-type-raw/#post-3568579)
 * Status: not resolved