Commit bceabb74 authored by Andrei Mondoc's avatar Andrei Mondoc
Browse files

improve profile preview modes

parent 724d732a
......@@ -269,11 +269,18 @@ class CiviCRM_Gutenberg_Blocks {
$atts['mode']
];
$_REQUEST['gid'] = $atts['gid'];
$_GET['gid'] = $_REQUEST['gid'] = $atts['gid'];
ob_start();
try {
( new CRM_Profile_Page_Router )->run( $args );
if ( $atts['mode'] == 'view' ) {
( new CRM_Profile_Page_View )->run();
} elseif ( $atts['mode'] == 'search' ) {
$_GET['reset'] = 1;
( new CRM_Profile_Page_Listings )->run();
} else {
( new CRM_Profile_Page_Router )->run( $args );
}
} catch ( Exception $e ) {
// silence
}
......@@ -582,5 +589,3 @@ function civicrm_gutenberg_blocks() {
// Init plugin.
add_action( 'plugins_loaded', 'civicrm_gutenberg_blocks' );
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment