function ddl_render_editor($inline) { global $wpddlayout; // Get layout if ($inline) { $post = get_post($_GET['post']); $layout_json = WPDD_Layouts::get_layout_json_settings_encoded_64($post->ID); if (!$layout_json) { // This post doesn't have a layout so create an empty one $preset_dir = WPDDL_RES_ABSPATH . '/preset-layouts/'; $layout = $wpddlayout->load_layout($preset_dir . '4-evenly-spaced-columns.ddl'); // Force fluid when using in post editor. $layout['type'] = 'fluid'; for ($i = 0; $i < sizeof($layout['Rows']); $i++) { $layout['Rows'][$i]['layout_type'] = 'fluid'; } $layout_json = wp_json_encode($layout); } } else { $post = get_post($_GET['layout_id']); // $layout_json_not_decoded = WPDD_Layouts::get_layout_settings($post->ID); $layout_json = WPDD_Layouts::get_layout_json_settings_encoded_64($post->ID); } ob_start(); WPDD_GUI_EDITOR::load_js_templates('/js/templates'); include_once 'templates/editor_box.tpl.php'; echo ob_get_clean(); }