Skip Navigation

[Resolved] Available parameters for types_render_usermeta

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to know what parameters are available for use with the PHP API types_render_usermeta.

Solution:
The values in this array should correspond to the attributes available for each type of field. Those are listed in the documentation here:
https://toolset.com/documentation/customizing-sites-using-php/functions/

For example, check the Address field information. There are two attributes that apply to all Address fields: output and format. Now click the orange "+More" button to reveal some additional information specific to User fields. Next to "attributes (user)" you will find information about 4 other attributes that can be used with User Address fields. You can use one of these attributes to define which User will be queried. Beneath this area, you will find a PHP example showing the syntax:

types_render_usermeta( "user-address", array( "user_current" => true )

You can add the other attributes you want to include in the array, and get information from another User like this:

types_render_usermeta( "user-address", array( "user_id" => 12345, "output" => "raw" ) )

Relevant Documentation:
https://toolset.com/documentation/customizing-sites-using-php/functions/

This support ticket is created 6 years, 10 months 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by viktorI 6 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#612887

Hello, on your documentation,
i can see that we can get user field by using this syntax

<?php echo(types_render_usermeta( 'field-slug', array( 'arg1' => 'val1', 'arg2' => 'val2' ) )); ?>

i wonder what parameter available to set for argument ? is it possible to get other user data ?

Thanks

#612998

The values in this array should correspond to the attributes available for each type of field. Those are listed in the documentation here:
https://toolset.com/documentation/customizing-sites-using-php/functions/

For example, check the Address field information. There are two attributes that apply to all Address fields: output and format. Now click the orange "+More" button to reveal some additional information specific to User fields. Next to "attributes (user)" you will find information about 4 other attributes that can be used with User Address fields. You can use one of these attributes to define which User will be queried. Beneath this area, you will find a PHP example showing the syntax:

types_render_usermeta( "user-address", array( "user_current" => true )

You can add the other attributes you want to include in the array, and get information from another User like this:

types_render_usermeta( "user-address", array( "user_id" => 12345, "output" => "raw" ) )
#613127

Thanks for clear explaination !