Get custom field on Contact Form 7 (with underscore)

559 Views Asked by At

I am trying to fill a field on the form with post_meta as explained in the documentation.

This custom field “edit_last” is working:

[text* edit_last default:post_meta]

But when the custom field starts with underscore, its not workin “_edit_last”:

[text* _edit_last default:post_meta]

How can I display custom fields that are starting with “_” (underscore).

My wordpress theme is generating some custom fields starting with underscore and I need to display some of them on the form.

1

There are 1 best solutions below

0
honk31 On

i have the same issue and i now solved it with another plugin (sorryyy) with this plugin you can write

[dynamichidden hidden-lotid "CF7_get_custom_field key='_sku'"]

to get custom field including hidden custom fields (custom fields starting with an underscore are considered hidden fields and will not be displayed in the edit pages).

sorry for this lousy answer, i usually do not recommend plugins and i certainly do not recommend contact form 7, i regret using it each and everytime i touch it.