Wednesday, April 10, 2013

Word Press Types plugin "Missing argument" error fix

If you have used the Types plugin in your Word Press site, you may come across this error:

"Warning: Missing argument 2 for types_render_field(), called in xxx.php on line xx and defined in..."

This is because the types_render_field now needs a second parameter which should be an array.
The parameters for field types:http://wp-types.com/documentation/functions/

The simple fix is:

Change this: "...types_render_field("xxx");"

To this: "...types_render_field("xxx", array('raw' => 'true'));"

Where "xxx" is your field name.

Happy coding!