Skip Navigation

[Resolved] Return Access Post Group Custom Names

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

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 3 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#1986275

We are trying to mass import a custom post type with a custom Toolset Access Post Group.

We have our post groups set. The custom post group names do not correlate to the viewable name from the admin panel. So it makes it very hard for our team to be able to find the right custom post group name to use to import.

Example:
1. Toolset Viewable Custom Post Group Name: session257
2. What shows on an export and the only way we can get it to import is to use: wpcf-custom-group-21a060f529b2482c2c461b345672bb22

I would hope and have unsuccessfully tested to try to import: wpcf-custom-group-session257 into the post custom field _wpcf_access_group

Am I missing something here on an easy way to import Post Group assignments?

If this is impossible, is there at least a way I could write some code to display this long unique custom name somewhere viewable and which Admin Name it correlates to. This way we could easily see either in the Post Group settings tab or on a custom page what unique name we need to use for each post group we have created.

Thanks!

#1986329

Hello,

It needs custom codes, for example, below custom shortcode can convert a Access post group name to group slug:

add_shortcode('access_name2slug',function($atts, $content){
	$atts = shortcode_atts( array(
        'name' => '',
    ), $atts );
	$access_settings = get_option( 'toolset-access-options' );
	$res = '';
	if(isset($access_settings->types)){
		foreach($access_settings->types as $k => $v){
			if(isset($v['title']) && $v['title'] == $atts['name']){
				$res = $k;
				break;
			}
		}
	}
	return $res;
});

Use above shortcode, like this:
[access_name2slug name="test access group 1"]

#1987085

Thanks so much for the assistance. For our situation we are trying to make it easy for our end user admins to see the unique name either on an admin page or directly on the post group settings page. That way they can easily copy and paste the unique toolset post group name into a CSV so they can mass import some custom posts. Is there a way to add the unique post group name in the toolset access post group settings tab?

#1988403
access-slug.JPG

No, there isn't such kind of built-in feature, but you can add a feature request for it:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
And you can get the slug from HTML source codes, see my screenshot: access-slug.JPG