Custom rewrite rule based on other custom post type title

So after 2 days of searching I found a solution. Permalink manager lite + this function and all works fine. //Rewrite rule function pm_extra_permastructure_tags($default_uri, $native_slug, $post, $slug, $native_uri) { // Do not affect native URIs if($native_uri == true || empty($post->post_type) || $post->post_type !== ‘mieszkanie’) { return $default_uri; } $inwestycja = get_field(‘inwestycja’, $post->ID); if( !empty($inwestycja) ) … Read more