Skip Navigation

[Closed] Warning: Missing argument 2 for types_render_field()

This support ticket is created 11 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 3 replies, has 3 voices.

Last updated by Jeroen 10 years, 9 months ago.

Author
Posts
#2107

Hi,
I have this warning message in the front-end when I try to display the content of my custom field. I don't see what could be the argument 2?

Warning: Missing argument 2 for types_render_field(), called in /var/www/i-system.be/htdocs/new/wp-content/themes/isystem/map-house.php on line 28 and defined in /var/www/i-system.be/htdocs/new/wp-content/plugins/types/embedded/frontend.php on line 28

My custom field slug is called "house1" (textarea field) and the my php code is <?php echo types_render_field("house1"); ?>. The content is well displayed but with the warning above.

Thanks for your help.

#2110

OK. I found the solution <?php echo types_render_field("house1", array('raw' => 'true')); ?>

#2112

Yes, the types_render_field needs a second parameter which should be an array.

The parameters for the different field types can be found here:
https://toolset.com/documentation/functions/

#8721

Could we make the second parameter of the types_render_field function optional, by making the default values real default values ?

Most of the times I don't need to set these parameters.

The topic ‘[Closed] Warning: Missing argument 2 for types_render_field()’ is closed to new replies.