lement['widgetType'] ) { $has_the_content = true; } } ); if ( ! $has_the_content ) { add_action( 'wp_footer', [ $this, 'preview_error_handler' ] ); } } return $data; } public function preview_error_handler() { $depended_widget_title = $this->get_depended_widget()->get_title(); wp_localize_script( 'elementor-frontend', 'elementorPreviewErrorArgs', [ /* translators: %s: Widget name. */ 'headerMessage' => sprintf( esc_html__( 'The %s Widget was not found in your template.', 'elementor-pro' ), $depended_widget_title ), /* translators: 1: Widget name, 2: Template name. */ 'message' => sprintf( esc_html__( 'You must include the %1$s Widget in your template (%2$s), in order for Elementor to work on this page.', 'elementor-pro' ), $depended_widget_title, '' . static::get_title() . '' ), 'strings' => [ 'confirm' => esc_html__( 'Edit Template', 'elementor-pro' ), ], 'confirmURL' => $this->get_edit_url(), ] ); } }