Problem:
I have a layout with some content and a CRED Edit Link in that Layout.
The Link should lead to the CRED Edit Form, but I want that Form to be displayed by a single Layout, not within the above mentioned Layout.
This way, i could replace teh ENTIRE template by a specific Layout, that holds only the CRED Form
Can I do that?
Solution:
Yes.
1. Create your specific Layout and add the CRED edit Form in it
2. Copy the ID of that Layout and replace the ID in the code below with it
3. The Code below shoudl go to your theme functions.php
add_filter('get_layout_id_for_render', function($id, $slug){
global $post;
if( null !== $post && $post->post_type === 'WHAT_I_NEED' && isset($_GET['cred-edit-form']) ){
$id = 'ID_OF_LAYOUT_I_WANT';
}
return $id;
} );
==> Replace WHAT_I_NEED with the Post Type Slug
==> Replace ID_OF_LAYOUT_I_WANT with the ID of the Layout with the CRED form