hello, I am trying to build a cred front end submission form which shows up only to logged in user, could you please give a piece of code about conditional output.
post type: room; cred id:12; one of custom field of post: my-field, value:1;
I am not sure what factor you need, so list something above
if the number of post by current user submitted is more then 1, then output message 1234
if the number of post by current user submitted is 0, that means on post submitted, then keep original message 0000
note: this message is not used to be displayed after user submitted, I know that is a built-in feature. it is used to notice what progressive of all forms has been completed. so it is diplayed at the top of page, Please Luo take over this ticket if possible, because I have submitted a similar ticket with him already before, it will help make sense of what I want to say , please see the link https://toolset.com/forums/topic/checking-if-a-form-has-been-submitted/#post-558436.
Best regards
Dear Jeffrey,
Please try [wpv-conditional] shortcode like this:
[wpv-conditional if="( $(wpcf-my-field) eq '1' )" ]
form has been submitted
[/wpv-conditional]
You can put above shortcode into the content of single custom post
More help:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
Can I add user_current='true' output='raw' to restrict that current user submitted form only will be output? because I tested already, it is working incorrectly
please check the screenshot attached.
[wpv-conditional if="( $(wpcf-my-field user_current='true' output='raw') eq '1' )"]<h5><i class="fa fa-exclamation-triangle" style="font-size: 24px;"></i> <a href="<em><u>hidden link</u></em>">Homestay demand</a></h5><h5><span style="font-size: 10pt;">Please submit a homestay demand.</span></h5>[/wpv-conditional]
[wpv-conditional if="( $(wpcf-my-field user_current='true' output='raw') ne '1')"] <h5><i class="fa fa-check-square-o" style="font-size: 24px;color: #009900"></i> <a href="<em><u>hidden link</u></em>">Homestay demand</a></h5><h5><span style="font-size: 10pt;">You have submitted at least one homestay demand.</span></h5>[/wpv-conditional]
could you please help check with the code for me? Thanks!
If it is the custom user field, you will need to use the user field shortcode insider wpv-conditional shortcode, for example:
[wpv-conditional if="[types usermeta='my-field' user_current='true' output='raw'][/types] eq 1"]
form has been submitted
[/wpv-conditional]