Skip Navigation

[Gelöst] Available parameters for types_render_usermeta

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

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 vor 6 Jahre, 2 Monate. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 Antworten, has 2 Stimmen.

Last updated by viktorI vor 6 Jahre, 2 Monate.

Assisted by: Christian Cox.

Author
Artikel
#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 !

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.