Skip Navigation

[Resolved] Check the WordPress field Description of a 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 6 replies, has 1 voice.

Last updated by Minesh 2 months, 3 weeks ago.

Assisted by: Minesh.

Author
Posts
#2785491

Hello,

I would like to test the content of the WordPress user field Description
What is the shortcode to do that
wpv-user-description is not working. Maybe I use the wrong fieldname

[wpv-conditional if = "($(wpv-user-description) eq 'some value')"]Some text[/wpv-conditional]

Thank you for your help

#2785586

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

What if you try to use the following code and check if that help you to resolve your issue:

[wpv-conditional if = "( '[wpv-user field='description']' eq 'some value')"]
Some text
[/wpv-conditional]

More info:
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-user
- https://toolset.com/documentation/legacy-features/views-plugin/#conditional-output-in-views

#2786085

This is not working

if I use [wpv-user field="description"] then I see the content of the field

but for the code with the condition it is not working

[wpv-conditional if = "( '[wpv-user field='description']' eq 'some value')"]
some text
[/wpv-conditional]

Is the code ok? Are is there another way?

Thanks

#2786113

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Do you want to check empty and not empty value for the user description field or something else?

#2786114

Hello,

for me it is also ok to check of the field is empty or not

#2786115

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

What if you try to use the following code:

For empty:

[wpv-conditional if = "( '[wpv-user field='description']' eq '')"]
The description field is empty
[/wpv-conditional]

For not-empty:

[wpv-conditional if = "( '[wpv-user field='description']' ne '')"]
The description field is NOT empty
[/wpv-conditional]
#2786120

Thanks for your reply, but still not ok ;-(

#2786122

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

That is really strange.

Can you please share problem URL where you added the conditional statement as well as admin access details and what description field you target (just to double check).

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2786135

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

The issue was you added the conditional statement to third-party plugin section and it should not have all dependency that should be required.

To fix this - I've created the following content tmeplate:
- hidden link

And added the conditional shortcode to the above content template as given under:

[wpv-conditional if = "( '[wpv-user field='description']' eq 'enkel vacatures')"]
Field is not empty and description field value is: [wpv-user field='description']
[/wpv-conditional]

Then to to place where you want to display the output:
=> hidden link

To display the content template I've added the following shortcode:

[wpv-post-body view_template="ct-for-user-desc-condition"]

Can you please confirm conditional statement using user description field works now.

More info:
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-body
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-conditional