Skip Navigation

[Resolved] Referring to custom post custom fields

This support ticket is created 5 years, 8 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 1 voice.

Last updated by KenG8581 5 years, 8 months ago.

Assisted by: Waqar.

Author
Posts
#1225670

Here is a non-validate snip explaining what is challenging me.

$risk_quest = get_post( $post_id );

// I would like to reference the fields directly like this ...
if ( $risk_quest -> wpcf-custom-field-number-2020 == '2' )
{
// Do something clever
}

But this fails - apparently due to the standard use of hyphens in the field slug.

How can I get this to work?

#1225683

My issue is resolved now. Thank you!