library.', 'elementor' ), 'library_connect_button_copy' => esc_html__( 'Connect', 'elementor' ), ] ); } private function get_document_types() { $document_types = Plugin::$instance->documents->get_document_types( [ 'show_in_library' => true, ] ); $data = []; foreach ( $document_types as $name => $document_type ) { $data[ $name ] = $document_type::get_title(); } return $data; } public function print_content() { if ( ! $this->print_preview_callback ) { $this->print_preview_callback = [ $this, 'print_thumbnail_preview_callback' ]; } call_user_func( $this->print_preview_callback ); } private function print_thumbnail_preview_callback() { $doc = Plugin::$instance->documents->get_current(); // PHPCS - should not be escaped. echo Plugin::$instance->frontend->get_builder_content_for_display( $doc->get_main_id(), true ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped wp_delete_post( $doc->get_main_id(), true ); } }