| @@ -4,9 +4,9 @@ | ||
| 4 | 4 | if (!defined('ABSPATH')) exit; |
| 5 | 5 | |
| 6 | 6 | define('PAGELAYER_BASE', plugin_basename(PAGELAYER_FILE)); |
| 7 | 7 | define('PAGELAYER_PREMIUM_BASE', 'pagelayer-pro/pagelayer-pro.php'); |
| 8 | -define('PAGELAYER_VERSION', '2.1.8'); | |
| 8 | +define('PAGELAYER_VERSION', '2.2.1'); | |
| 9 | 9 | define('PAGELAYER_DIR', dirname(PAGELAYER_FILE)); |
| 10 | 10 | define('PAGELAYER_SLUG', 'pagelayer'); |
| 11 | 11 | define('PAGELAYER_URL', plugins_url('', PAGELAYER_FILE)); |
| 12 | 12 | define('PAGELAYER_CSS', PAGELAYER_URL.'/css'); |
| @@ -25,8 +25,9 @@ | ||
| 25 | 25 | define('PAGELAYER_FONT_POST_TYPE', 'pagelayer-fonts'); |
| 26 | 26 | |
| 27 | 27 | include_once(PAGELAYER_DIR.'/main/functions.php'); |
| 28 | 28 | include_once(PAGELAYER_DIR.'/main/class.php'); |
| 29 | +include_once(PAGELAYER_DIR.'/main/ai-controller.php'); | |
| 29 | 30 | |
| 30 | 31 | function pagelayer_died(){ |
| 31 | 32 | print_r(error_get_last()); |
| 32 | 33 | } |
| @@ -541,18 +542,12 @@ | ||
| 541 | 542 | $blocks = parse_blocks( wp_unslash($content) ); |
| 542 | 543 | $output = ''; |
| 543 | 544 | |
| 544 | 545 | foreach ( $blocks as $block ) { |
| 545 | - $block_name = $block['blockName']; | |
| 546 | 546 | |
| 547 | - // Is pagelayer block | |
| 548 | - if ( is_string( $block_name ) && 0 === strpos( $block_name, 'pagelayer/' ) ) { | |
| 549 | - $_block = pagelayer_sanitize_blocks_save_pre($block); | |
| 550 | - $output .= serialize_block($_block); | |
| 551 | - continue; | |
| 552 | - } | |
| 553 | - | |
| 554 | - $output .= serialize_block($block); | |
| 547 | + // Sanitize Pagelayer blocks at any depth, they can be nested inside | |
| 548 | + // any other block | |
| 549 | + $output .= serialize_block( pagelayer_sanitize_block_tree( $block ) ); | |
| 555 | 550 | } |
| 556 | 551 | |
| 557 | 552 | return wp_slash($output); |
| 558 | 553 | } |