задачу решил:
function add_custom_rewrite_rule() {
if( ($current_rules = get_option('rewrite_rules')) ) {
foreach($current_rules as $key => $val) {
if(strpos($key, 'event') !== false) {
add_rewrite_rule(str_ireplace('event', 'events', $key), $val, 'top');
} // end if
} // end foreach
} // end if/else
//flush_rewrite_rules();
} // end add_custom_rewrite_rule
add_action('init', 'add_custom_rewrite_rule');
function na_remove_slug( $post_link, $post, $leavename ) {
if ( 'event' != $post->post_type || 'publish' != $post->post_status ) {
return $post_link;
}
$post_link = str_replace( '/' . $post->post_type . '/', '/events/', $post_link );
return $post_link;
}
add_filter( 'post_type_link', 'na_remove_slug', 10, 3 );
add_action( 'template_redirect', function() {
if( is_singular( 'event' ) ){
global $post;
if ( $_SERVER['REQUEST_URI'] == '/event/'.$post->post_name) {
wp_redirect( home_url('/events/'.$post->post_name), 301 );
exit();
}
}
} );