Skip Navigation

[Resolved] Access: Get list of access groups

This support ticket is created 7 years, 1 month 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.

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)

This topic contains 5 replies, has 2 voices.

Last updated by Christian Cox 7 years ago.

Assisted by: Christian Cox.

Author
Posts
#577716

Hi!

until recently I received a list of access-groups using the following code:

global $wpdb;
$query = "SELECT meta_value FROM $wpdb->postmeta WHERE meta_key = '_wpcf_access_group'";
$groups = $wpdb->get_results( $query );

recently this code only receives old groups that have been added a long time, the new added groups do not receive this code,

instead of several new groups, this code receive one is unusual:

{ ["meta_value"]=> string(50) "wpcf-custom-group-7318b1bc8403a58f10e1f9b9fddf6b9d" }

how do I programmatically get a list of ALL the access-groups?

p.s. access version 2.3.1 (newer versions can not be used due to errors described in other my tickets).

thank you!

#577746

Hello, let me ask my 2nd tier support team if there is a good way to get a list of all Access groups in version 2.3.1. There's no public API available, but they may be able to provide additional advice. Please stand by and I will update you when I have more to share.

#577819

hi, Christian!

thanks, I'll wait.

#579514

Sorry, our 2nd tier team has been unable to provide a suggestion that will help you query for all the Access groups in the database. There is currently a feature request filed to create a public API for this purpose, but as of today that request has not yet been implemented.

This ticket discusses a few Access group conditional approaches that may help you instead:
https://toolset.com/forums/topic/important-need-senior-level-assistance/

I'll keep you posted here as I hear more about the feature request, but I do not have a timeline available for implementation yet.

#580827

HI, Christian!

I will study the information on the link above and let you know if it was possible to solve the problem or I still need help,

Thanks!

#580887

Okay sure, I will mark this ticket as pending an update from you. No need to reply right away, the ticket will remain open for 30 days.