| @@ -1,12 +1,12 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * @package FireBox |
| 4 | - * @version 1.1.1 Free | |
| 4 | + * @version 2.0.12 Free | |
| 5 | 5 | * |
| 6 | 6 | * @author FirePlugins <info@fireplugins.com> |
| 7 | 7 | * @link https://www.fireplugins.com |
| 8 | - * @copyright Copyright © 2022 FirePlugins All Rights Reserved | |
| 8 | + * @copyright Copyright © 2023 FirePlugins All Rights Reserved | |
| 9 | 9 | * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | namespace FireBox\Core\Helpers; |
| @@ -265,9 +265,9 @@ | ||
| 265 | 265 | { |
| 266 | 266 | return; |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | - $local_template_path = FBOX_PLUGIN_DIR . 'media/admin/templates/template.json'; | |
| 269 | + $local_template_path = \FPFramework\Helpers\WPHelper::getPluginUploadsDirectory('firebox', 'templates') . '/template.json'; | |
| 270 | 270 | if (!file_exists($local_template_path)) |
| 271 | 271 | { |
| 272 | 272 | return; |
| 273 | 273 | } |
| @@ -327,17 +327,19 @@ | ||
| 327 | 327 | $box = $box[0]; |
| 328 | 328 | $box->ID = ''; |
| 329 | 329 | $box->post_title = 'Copy of ' . $box->post_title; |
| 330 | 330 | $box->post_status = 'draft'; |
| 331 | - | |
| 332 | - // insert new box | |
| 333 | - $new_box_id = firebox()->tables->box->insert($box); | |
| 334 | 331 | |
| 332 | + Form\Form::ensureUniqueFormIDs($box->post_content); | |
| 333 | + | |
| 335 | 334 | // get meta options |
| 336 | 335 | $meta = self::getMeta($box_id); |
| 337 | 336 | |
| 337 | + // insert new box | |
| 338 | + $new_box_id = firebox()->tables->box->insert($box); | |
| 339 | + | |
| 338 | 340 | // add meta options for new box |
| 339 | - update_post_meta($new_box_id, 'fpframework_meta_settings', $meta); | |
| 341 | + update_post_meta($new_box_id, 'fpframework_meta_settings', wp_slash($meta)); | |
| 340 | 342 | } |
| 341 | 343 | |
| 342 | 344 | /** |
| 343 | 345 | * Reset Box Stats |
| @@ -405,10 +407,8 @@ | ||
| 405 | 407 | 'meta' => $meta |
| 406 | 408 | ]; |
| 407 | 409 | } |
| 408 | 410 | |
| 409 | - $string = json_encode($exported); | |
| 410 | - | |
| 411 | 411 | // SET DOCUMENT HEADER |
| 412 | 412 | if (preg_match('#Opera(/| )([0-9].[0-9]{1,2})#', $_SERVER['HTTP_USER_AGENT'])) |
| 413 | 413 | { |
| 414 | 414 | $UserBrowser = "Opera"; |
| @@ -440,8 +440,8 @@ | ||
| 440 | 440 | header('Pragma: no-cache'); |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | // PRINT STRING |
| 444 | - echo $string; | |
| 445 | - die; | |
| 444 | + echo wp_json_encode($exported); | |
| 445 | + die(); | |
| 446 | 446 | } |
| 447 | 447 | } |