Skip Navigation

[Resolved] dinamically populate a custom field's checkboxes with WP user groups

This support ticket is created 7 years, 4 months ago. 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.

Our next available supporter will start replying to tickets in about 5.67 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#542983
4 - toolset access limits access to data only to admins, editors and the list of selected checkboxes in the current product.png
3 - checkboxes to be chisen in the product edit screen.png
2 - custom field to e dinamically populated by wp grous names.png
1 - groups names to be used to dinamically populate the toolset custom field's checkboxes.png

I am trying to: i need to limit the serving of a specific part of a product page only to selected groups; the groups have been created using the "Groups" plugin (see: hidden link - see attached screen #1): my aim is to serve only a part of the page to selected registered users.
i created a custom content area in the backend with the toolset plugin (a metabox with some custom fields - see attached screen #2), and created a custom content template with views to display those data;
i used toolset access to limit the serving of this part of the product only to selected groups - see attached screen #4;
the groups are created with the "WP Groups" plugin.
by now the system works, but i need to manually sync the group names and the checkboxes in the product edit screen, modifying each time the checkboxes list in the toolset CF group - see attached screen #3.
i'd like to dinamically auto-populate the "checkboxes" custom field with the names of the WP user groups created with the plugin "WP Groups", so if i change the name and/or add/delete some group, the system will always be automatically synced through the groups and the single products data access.

I visited this URL:

I expected to see:

Instead, I got:

#543081

Hi, let me make sure I understand what you would like to do. You want your custom select field to include an option for each Group. Groups are created by WP Groups. When a Group is modified, added or deleted, the changes should be reflected in the checkboxes custom field.

Is this correct? Which WP Groups API hooks should I rely on? You may need to check their documentation or ask their support team. hidden link

Here's what I would ask support, if you're not able to understand their API:
"I want to trigger some code whenever a Group is [modified, added, edited, deleted, whatever you want]. What action hooks should I be using from your API to trigger this code?"

When you have that information, I can provide some further guidance here.