| @@ -1,12 +1,12 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * @package FireBox |
| 4 | - * @version 1.0.2 Free | |
| 4 | + * @version 2.0.6 Free | |
| 5 | 5 | * |
| 6 | 6 | * @author FirePlugins <info@fireplugins.com> |
| 7 | 7 | * @link https://www.fireplugins.com |
| 8 | - * @copyright Copyright © 2021 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\FB; |
| @@ -42,8 +42,9 @@ | ||
| 42 | 42 | |
| 43 | 43 | $blockName = $block['blockName']; |
| 44 | 44 | |
| 45 | 45 | $parsable_blocks = [ |
| 46 | + 'firebox/buttons', | |
| 46 | 47 | 'core/buttons', |
| 47 | 48 | 'core/image' |
| 48 | 49 | ]; |
| 49 | 50 | |
| @@ -54,9 +55,9 @@ | ||
| 54 | 55 | |
| 55 | 56 | /** |
| 56 | 57 | * Handle Core Buttons Block |
| 57 | 58 | */ |
| 58 | - if ($blockName == 'core/buttons') | |
| 59 | + if (in_array($blockName, ['core/buttons', 'firebox/buttons'])) | |
| 59 | 60 | { |
| 60 | 61 | $buttons = isset($block['innerBlocks']) ? $block['innerBlocks'] : []; |
| 61 | 62 | if (!$buttons) |
| 62 | 63 | { |
| @@ -105,21 +106,27 @@ | ||
| 105 | 106 | |
| 106 | 107 | $new_block_html = $block['innerHTML']; |
| 107 | 108 | |
| 108 | 109 | // box |
| 109 | - if ($atts['box']) | |
| 110 | + if (!is_null($atts['box']) && $atts['box'] !== 'none') | |
| 110 | 111 | { |
| 111 | - $new_block_html = str_replace('<' . $element . ' ', '<' . $element . ' data-fbox="' . esc_attr($atts['box']) . '" ', $new_block_html); | |
| 112 | - } | |
| 112 | + if ($atts['box'] !== 'current') | |
| 113 | + { | |
| 114 | + $new_block_html = str_replace('<' . $element . ' ', '<' . $element . ' data-fbox="' . esc_attr($atts['box']) . '" ', $new_block_html); | |
| 115 | + } | |
| 113 | 116 | |
| 114 | - // cmd | |
| 115 | - if ($atts['cmd']) | |
| 116 | - { | |
| 117 | - $new_block_html = str_replace('<' . $element . ' ', '<' . $element . ' data-fbox-cmd="' . esc_attr($atts['cmd']) . '" ', $new_block_html); | |
| 117 | + // cmd | |
| 118 | + if ($atts['cmd']) | |
| 119 | + { | |
| 120 | + $new_block_html = str_replace('<' . $element . ' ', '<' . $element . ' data-fbox-cmd="' . esc_attr($atts['cmd']) . '" ', $new_block_html); | |
| 121 | + } | |
| 122 | + | |
| 123 | + // prevent default | |
| 124 | + if (isset($atts['preventDefault'])) | |
| 125 | + { | |
| 126 | + $new_block_html = str_replace('<' . $element . ' ', '<' . $element . ' data-fbox-prevent="' . esc_attr((int) $atts['preventDefault']) . '" ', $new_block_html); | |
| 127 | + } | |
| 118 | 128 | } |
| 119 | - | |
| 120 | - // prevent default | |
| 121 | - $new_block_html = str_replace('<' . $element . ' ', '<' . $element . ' data-fbox-prevent="' . esc_attr((int) $atts['preventDefault']) . '" ', $new_block_html); | |
| 122 | 129 | |
| 123 | 130 | // class |
| 124 | 131 | if ($atts['class']) |
| 125 | 132 | { |