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 );
}
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!
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?
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!
Fixes are added for next release for both issues.
Thanks.
Awesome! Looking forward to it…
Thanks Srdjan!