Sauter la navigation

[Résolu] Limit parent posts in Form select field to user’s own posts

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:
How to limit the parent posts in Form parent select field to user's own posts.

Solution:
You can now manually add the attribute author="$current" to the cred_field shortcode for the parent selector.

This support ticket is created Il y a 6 années et 7 mois. There's a good chance that you are reading advice that it now obsolete.

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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par PiotrO586 Il y a 6 années et 7 mois.

Assisté par: Nigel.

Auteur
Publications
#915115

Hi,

I have a form where I need to select parent post. I'd like to restrict parent posts only to these belonging to the logged user. For Types 3.0, is this approach still valid:
https://toolset.com/forums/topic/cred-field-showing-too-many-option-in-form-select-box/
or there is another way to do it resulting from the software update?

#915193

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Hi Piotr

I'm happy to say that we improved this on the latest plugin updates, though I'm not sure it is well documented.

When you insert the parent selector field in the form (which would be added if you auto-generate the form markup) you can add the attribute author="$current" so that the select dropdown only includes parent posts authored by the current user.

I just tested using it for the first time and it works.

#915282

Thank you Nigel, it works as expected.