| @@ -194,8 +194,20 @@ | ||
| 194 | 194 | return true; |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | /** |
| 198 | + * Whether WordPress post preview or Elementor preview iframe is active. | |
| 199 | + * | |
| 200 | + * @since 4.1.0 | |
| 201 | + * @access public | |
| 202 | + * | |
| 203 | + * @return bool | |
| 204 | + */ | |
| 205 | + public function is_editor_or_preview() { | |
| 206 | + return is_preview() || $this->is_preview_mode(); | |
| 207 | + } | |
| 208 | + | |
| 209 | + /** | |
| 198 | 210 | * Builder wrapper. |
| 199 | 211 | * |
| 200 | 212 | * Used to add an empty HTML wrapper for the builder, the javascript will add |
| 201 | 213 | * the content later. |