Skip Navigation

[Resolved] Function types_render_usermeta_field() seems to be deprecated. Alternative?

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 8 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 9 replies, has 2 voices.

Last updated by Shane 8 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#372631

I am trying to: make use of user meta to display in post meta like,

"if(types_render_usermeta_field("Name", array('raw' => 'true')) != 1 && types_render_usermeta_field("Name", array('raw' => 'true')) != '') {

echo do_shortcode('[types usermeta="name"][/types]');
}"
However, after the latest upgrade, types_render_usermeta_field() got deprecated.

types/embeded/usermeta-init.php:354
says
" * @deprecated (types_render_usermeta_field) I can not find where it is being used, we use types_render_usermeta() instead"

In that case,
How is the usage of types_render_usermeta() ? Is it same as types_render_usermeta_field()?
Couldn'T locate any resource for that.

#372687

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Vineet,

Thank you for contacting our support forum.

I'm not seeing where in our documentation that the types_render_usermeta_field() function has been depracated.

https://toolset.com/documentation/user-guides/displaying-wordpress-user-fields/

I see where we still have it active in our documentation.

Could you ensure that you are running version 1.9 of our Types plugin.

Thank,
Shane

#378963

Hi,
Following line at types/embeded/usermeta-init.php:354 says, this thing
I am running types 1.9 and wordpress 4.4.2 with polylang 1.8.4

/**
 * Calls view function for specific field type.
 *
 * @global object $wpdb
 *
 * @param type $field
 * @param type $atts
 * @return type
 *
 * @deprecated I can not find where it is being used, we use types_render_usermeta() instead
 */
function types_render_usermeta_field( $field_id, $params, $content = null,
        $code = '' ) {

    require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields.php';
    global $wpcf, $post, $wpdb;

IDE is marking types_render_usermeta_field() as deprecated and showing Deprecated notice.
So, currently, as mentioned earlier,
It is not showing the custom field on English website.
Moreover, Another issue I have discovered is
Post category meta box disappears in version 1.9 for me.
If I install version 1.6.6.6 everything works fine. If I upgrade to 1.7 category meta box disappears

but in 1.7, custom field on English version of site work from

if(types_render_usermeta_field("Name", array('raw' => 'true')) != 1 && types_render_usermeta_field("Name", array('raw' => 'true')) != '') {

echo do_shortcode('[types usermeta="name"][/types]');
}"

in version 1.9, custom field on English version of the site doesn'T work via aforementioned call along with post category selector meta box.

Looking forward to hear a word from your side.
Regards

#379025

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Vineet,

Thank you for pointing this out.

Our documentation seem to not be updated on this.

What I can do is to mention this to our documentation team so they can update the documentation appropriately for this.

Does the types_render_usermeta() function works as expect?

Please let me know.

Thanks,
Shane

#379192

Hi,
Unfortunately, I couldn't locate any resource for the usage of types_render_usermeta()
Could you please connect me with any documentation link, in case the method types_render_usermeta_field() is changed to types_render_usermeta()

Regards

#379290

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Vineet,

We do not have any documentation on this but from what I see in the code both functions use the same parameters so the documentation for the types_render_usermeta_field should be relevant for the types_render_usermeta function as well.

Thanks,
Shane

#379477

Okay, I shall try with that.
Moreover,
the second issue:
I mentioned in my earlier response,

Post category meta box (category selector for post in backend) disappears in version 1.9 for me.
If I install version 1.6.6.6 everything works fine. If I upgrade to 1.7 category meta box disappears

Let me know, what could be done this case.
Regards

#379672

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Vineet,

Please let me know how it goes.

Regarding your second issue I would recommend opening a separate ticket because if we were to debug the issue in this thread it may lead to multiple pages on a problem that this original thread was not about 🙁

For ease of use and streamlining our forum we recommend 1 issue per ticket so other customers can benefit from the discussions.

Please let me know if you are ok with this.

Thanks,
Shane

#380950

All right, I shall open a new support thread.
and regarding the first issue, will let you know after trying.

#381029

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Vineet,

Thanks,

Please update me as soon as possible.

Thanks,
Shane

The forum ‘Types Community Support’ is closed to new topics and replies.

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