| @@ -6,9 +6,9 @@ | ||
| 6 | 6 | use Elementor\Controls_Stack; |
| 7 | 7 | use Elementor\Plugin; |
| 8 | 8 | |
| 9 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | - exit; // Exit if accessed directly. | |
| 10 | + exit; // Exit if accessed directly | |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | class Module extends \Elementor\Core\Base\Module { |
| 14 | 14 | |
| @@ -101,9 +101,9 @@ | ||
| 101 | 101 | * |
| 102 | 102 | * @return void |
| 103 | 103 | */ |
| 104 | 104 | protected function add_page_convert_button( Controls_Stack $controls_stack ) { |
| 105 | - if ( ! Plugin::$instance->editor->is_edit_mode() || ! $this->page_contains_sections( $controls_stack ) || ! Plugin::$instance->role_manager->user_can( 'design' ) ) { | |
| 105 | + if ( ! Plugin::$instance->editor->is_edit_mode() ) { | |
| 106 | 106 | return; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | $controls_stack->start_injection( [ |
| @@ -124,31 +124,8 @@ | ||
| 124 | 124 | ] |
| 125 | 125 | ); |
| 126 | 126 | |
| 127 | 127 | $controls_stack->end_injection(); |
| 128 | - } | |
| 129 | - | |
| 130 | - /** | |
| 131 | - * Checks if document has any Section elements. | |
| 132 | - * | |
| 133 | - * @param \Elementor\Controls_Stack $controls_stack | |
| 134 | - * | |
| 135 | - * @return bool | |
| 136 | - */ | |
| 137 | - protected function page_contains_sections( $controls_stack ) { | |
| 138 | - $data = $controls_stack->get_elements_data(); | |
| 139 | - | |
| 140 | - if ( ! is_array( $data ) ) { | |
| 141 | - return false; | |
| 142 | - } | |
| 143 | - | |
| 144 | - foreach ( $data as $element ) { | |
| 145 | - if ( isset( $element['elType'] ) && 'section' === $element['elType'] ) { | |
| 146 | - return true; | |
| 147 | - } | |
| 148 | - } | |
| 149 | - | |
| 150 | - return false; | |
| 151 | 128 | } |
| 152 | 129 | |
| 153 | 130 | /** |
| 154 | 131 | * Initialize the Container-Converter module. |