Skip Navigation

[Résolu] Hi

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 2 réponses, has 2 voix.

Last updated by jamesH-3 Il y a 6 années et 11 mois.

Assigned support staff: Waqas.

Auteur
Publications
#263795

I am trying to show a CRED Edit link only to an administrator or a user with Confirmed membership status (which is a custom field) status.

I think I have worked out how to show only to users with confirmed membership status:
[wpv-if membershipstatuscondition="wpcf-membership-status" evaluate="$membershipstatuscondition='Confirmed'"]
[cred_link_form form="Edit Contact Details for LI Users" text="Click Here to Edit" target="_blank"]
[/wpv-if]

[wpv-if membershipstatuscondition="wpcf-membership-status" evaluate="$membershipstatuscondition='Pending'"]<bold>Unable to chnage due to Pending Membership*</bold> [/wpv-if]
[wpv-current-user info="role"]

However, this means Administrator cannot see it either. So I have used:

[wpv-if evaluate="'[wpv-current-user info="role"]'='Administrator'"]

[cred_link_form form="Edit Contact Details for LI Users" text="Click Here to Edit" target="_blank"]

[/wpv-if]

However, this does not seem to work. Can you see why it is not working?

Thanks

#263797

Waqas
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

Your following code works fine, however please notice that info="role" returns roles in small letters only (i.e. "administrator"). Please consider the change made below:

[wpv-if evaluate="'[wpv-current-user info="role"]'='administrator'"]

[cred_link_form form="Edit Contact Details for LI Users" text="Click Here to Edit" target="_blank"]

[/wpv-if]

Please let me know if I can help you with anything related.

#263800

Hi Waqas,
Yes, that resolved the issue.
Thanks for your quick response.