Skip Navigation

[Resolved] Edit custom fields but not publish

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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 1 reply, has 2 voices.

Last updated by Mateus Getulio 1 year, 3 months ago.

Assisted by: Mateus Getulio.

Author
Posts
#2629501

Hey is there a way for an author role or contibutor to edit custom fields but will not be live until the admin approve it?

#2629739

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hey there,

Thank you for contacting our support.

I'm afraid that currently there's no built-in feature for you to accomplish that. Some custom code would be necessary.

The fields groups are added to the wp_posts table, in the Toolset listing page when you're editing them you can either set them to 'active' or 'not active'. Inside the database, 'active' means the post has a status of 'published', while 'not active' groups have a status of 'draft'.

I believe you would be able to catch the action of editing/creating a new custom field group by using the WordPress hook update_option(https://developer.wordpress.org/reference/hooks/update_option/).

Then, you can test the user's role and set the post status to 'draft', that will cause that field group to appear as disabled in the Toolset list. After that, you'd be able to manually set that field group to active on the Toolset custom field groups listing page.

Please have in mind that giving support to custom code is out of the scope of this forum. The hints I shared could point you in the right direction, but we can't create, debug or modify custom code for you and it's your responsibility to maintain it.

If implementation becomes a roadblock, you might want to explore the list of Toolset Contractors for assistance: https://toolset.com/contractors/

Kind regards,
Mateus