Skip Navigation

[Résolu] CRED form to edit a cutom field by a logged in user

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.

This topic contains 6 réponses, has 2 voix.

Last updated by jamesH-3 Il y a 7 années et 12 mois.

Auteur
Publications
#170661
ss4.png
ss3.png
ss2.png
ss1.png

Hi

I am trying to allow logged in users to edit certain custom fields.

I have tried to this with the company description custom field. I have managed to create a view to display the company description field for the logged in user with no problem. However, the CRED form I created to update this field does not seem to work.

I does show a submit button but nothing else. I does not actually allow you to change the text.

I have attached the screenshots

Thanks

#170683

Agnes Bury
Supporter

Languages: Anglais (English )

Timezone: Pacific/Midway (GMT-11:00)

jamesH-3, hi again.
I will assist you to solve your problem but first let me make sure the screenshots are relevant. I guess these are the Views screenshots not CRED ones.

#170702
ss4.png
ss3.png
ss2.png
ss1.png

Sorry about that Agnes, they are the wrong screenshots. Find the correct ones attached.

#170723

Agnes Bury
Supporter

Languages: Anglais (English )

Timezone: Pacific/Midway (GMT-11:00)

jamesH-3, are you sure? Or maybe there is something wrong with the software here...

#170748
screenshot4.png
screenshot3.png
screenshot2.png
screenshot1.png

Hi Agnes
I dont know what's happening here. I have renamed the files and trying again.
Thanks

#170770

Agnes Bury
Supporter

Languages: Anglais (English )

Timezone: Pacific/Midway (GMT-11:00)

edit-product-template.JPG
logged-in-user.JPG
not-logged-in-user.JPG

jamesH-3, thank you for the screenshots.

You set up the CRED form right. What needs adjustment is the place you insert you CRED form shortcode into.

Let me explain how it works by example:
Suppose you have a product custom post type.
Now you create a CRED form to edit a product.
Now you have to insert the CRED form you created into the relevant place. A place which is related to a specific product. The best place would be to use Content Temple for a single product. Then the form will be applied to a specific product which is currently displayed.

See pictures attached.
Below I show you how to allow only logged in users for edition.

[wpv-if evaluate="'[wpv-current-user info="logged_in"]' = 'true'"]
<div class="logincontainer loggedin"> 
<p>Hello <span>[wpv-current-user info="firstname"] [wpv-current-user info="lastname"]</span></p>
</div>
[cred_link_form form="Edit product" text="Edit %TITLE%" target="_self"]
[/wpv-if]

[wpv-if evaluate="'[wpv-current-user info="logged_in"]' = 'false'"]
<div class="logincontainer loggedout">
   <strong>You must be loggin to use the option</strong>
</div>
[/wpv-if]

<h1>[wpv-post-title]</h1>
[wpv-post-body view_template="None"]

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have

#174521

Thanks