內容簡介
這個外掛將SweetAlert2 script添加到Contact Form 7 WordPress 外掛的提交過程中。
這個外掛需要 Contact Form 7 外掛才能運作。
只需啟用它,即可將 CF7 默認提交輸出替換為 SweetAlert2 浮出層。
該附加組件將在彈出窗口中顯示 Contact Form 7 的消息。
如果需要的話,您可以為警報設置自定義持續時間和自定義標題。
這個外掛是 akandor 和 Antoine Derrien 創建的外掛的增強版,這個版面被 WordPress 安全團隊關閉了。
這個外掛的基礎被使用,並且所有這些都已被改進:
-僅在設置頁面加載管理員樣式
-刪除具有少量 CSS 內容的樣式表(直接嵌入,因為為幾行載入樣式表是沒有意義的)
-對數據輸入和輸出進行消毒處理(因為易受 XSS 攻擊)
-從 sweetalert 更新 css 和 js 文件(因為它非常過時)
-再次顯示 sweetalert 圖標
-刪除不必要的代碼和文件
-修正 Css,因為有些主題有衝突
-只在檢測到聯繫表格短代碼時加載 js 和 css(除了一個腳本)
-標題現在默認轉換為大寫
它是如何運作的?
它加載腳本和樣式來取代 CF7 提交過程,並裝載 SweetAlert2 腳本。
外掛標籤
開發者團隊
② 後台搜尋「Add-on SweetAlert Contact Form 7」→ 直接安裝(推薦)
原文外掛簡介
This plugin adds the SweetAlert2 script into Contact Form 7 wordpress plugin submission process.
This plugin requires the Contact Form 7 plugin to work.
Just activate it to replace CF7 default submission output by a SweetAlert2 pop up.
The add-on will display the Contact Form 7 messages in the pop up.
If you want, you can set a custom duration and a custom title for the alerts.
This plugin is an enhancement to the plugin created by akandor, Antoine Derrien which was closed by WordPress security team
Its base has been used and all this has been improved:
-Load admin styles only on the settings page
-Removed style sheets with little css content (It has been directly embedded, as it does not make sense load a sheet for a few lines)
-Sanitize data input and output (Since it was vulnerable to XSS attacks)
-Update css and js files from sweetalert (Since it was very outdated)
-Show sweetalert icons again
-Remove unnecessary code and files
-Css fix, since there was conflict with some themes
-Load the js and css only when the contact form shortcode is detected (Except a script)
-Titles are now converted to uppercase by default
How does it work?
It enqueues scripts and styles to override CF7 submission process and surcharge it with SweetAlert2 scripts.
