Please use this extended code instead. It contains additional snippet that filters get_post_type_archive_link() function:
function pm_detect_post_archives($request) {
global $wp, $permalink_manager_permastructs, $wp_rewrite;
if(!empty($permalink_manager_permastructs['post_types']) && empty($request['do_not_redirect'])) {
foreach($permalink_manager_permastructs['post_types'] as $post_type => $permastructure) {
$pattern = pm_get_post_type_archive_base($post_type);
// Escape slashes
$pattern = preg_quote($pattern, "/");
preg_match("/^\/?{$pattern}(?:(\/{$wp_rewrite->pagination_base})\/([\d]+))?\/?$/mi", trim($wp->request, '/'), $parts);
if(!empty($parts[0])) {
$request = array(
'post_type' => $post_type,
'do_not_redirect' => 1,
);
// Suport pagination
if(!empty($parts[2])) {
$request['paged'] = $parts[2];
}
return $request;
}
}
}
return $request;
}
add_filter('request', 'pm_detect_post_archives', 99);
function pm_get_post_type_archive_base($post_type) {
global $permalink_manager_permastructs, $permalink_manager_options;
if(!empty($permalink_manager_permastructs['post_types'][$post_type])) {
$do_not_append_slug = (!empty($permalink_manager_options['permastructure-settings']['do_not_append_slug']['post_types'][$post_type])) ? true : false;
// Get the permastructure
$post_type_archive_slug = $permalink_manager_permastructs['post_types'][$post_type];
// Remove the last part
$post_type_archive_slug = ($do_not_append_slug) ? preg_replace('/(.*)\/([^\/]+)$/', '$1', $post_type_archive_slug) : $post_type_archive_slug;
// Remove the dynamic parts
$post_type_archive_slug = preg_replace('/((?:[^\/]+)?(?:%[^\/]+%)(?:[^\/]+)?)/', '', $post_type_archive_slug);
// Remove duplicated slashes
$post_type_archive_slug = trim(preg_replace('/(\/+)/', '/', $post_type_archive_slug), '/');
return $post_type_archive_slug;
} else {
return '';
}
}
function pm_post_type_archive_link($link, $post_type) {
$pm_archive_base = pm_get_post_type_archive_base($post_type);
return ($pm_archive_base) ? sprintf('%s/%s', trim(get_home_url(), '/'), $pm_archive_base) : $link;
}
add_filter('post_type_archive_link', 'pm_post_type_archive_link', 99, 2);