[WordPress] 外掛分享: Quick Code

首頁外掛目錄 › Quick Code
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
10+
安裝啟用
尚無評分
6245 天前
最後更新
問題解決
WordPress 2.6+ v1.0 上架:2009-03-25

內容簡介

這是一個非常有用的外掛,讓網站管理員可以快速測試程式碼片段(HTML、CSS、PHP、MySQL)。我們經常需要測試程式碼,特別是在開發 WordPress 外掛時,例如需要知道某個資料庫呼叫會傳回什麼,或想知道使用某個 PHP 或 WordPress 函式、常數或物件會有什麼效果。只需輸入所需的程式碼,便會顯示輸出!

以前,我們通常必須建立一些「echo」語句來進行測試,但這可能會在訪客前台網頁中顯示(這在實時網站上是不可取的)。現在有了這個方法,可以在網站的管理區域中快速測試程式碼。

此外,此外掛也可以用作簡單的所見即所得 HTML/CSS 編輯器,輸入完程式碼後直接顯示結果。

但這還不是全部!當外掛頁面載入時,會自動包含三個外部檔案。其中兩個是 JavaScript 和 CSS 檔案,當外掛頁面載入時會在管理員頁首部分包含這些檔案。這樣就可以像平常一樣設置 JavaScript 函式和樣式表。

然後您可以將程式碼複製並貼上到自己的外部檔案中(例如開發自己的外掛或建立網頁中)。第三個檔案包含 PHP 程式碼,旨在存儲 PHP 函式。這樣,這些函式就可以直接從主編輯框中調用。

您可以在此查看我們的其他外掛。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Quick Code」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

A very useful utility that allows blog administrators to quickly test code fragments (HTML, CSS, PHP, MySQL). There has been many times that I needed to test bits of code to see exactly what the output would be. For instance, whilst developing a WordPress Plugin, you may need to know what a certain database call will return, or want to know the effect of using a PHP or WordPress function, constant, or object. Simply enter in the required code and the output is displayed!
Usually this meant I had to set-up test ‘echo’ statements and risk this being visible on the main site pages by visitors (which is undersirable on a live site). Now there is a way to quickly test code which is only displayed in the admin area of your blog.
This Plugin can also be used as a simple WYSIWYG HTML/CSS editor, the results of the code are displayed directly above the code input box.
But, that is not all! There are three external files that are automatically included when the Plugin page renders. Two of these are a JavaScript, and CSS file, which are included in the admin head section when the Plugin page loads. This enables you to set-up JavaScript functions, and Style sheets just as you would normally.
You can then copy and paste the code into your own external files (when developing your own Plugins, or creating web pages). The third file contains PHP code that is designed to store PHP functions. This is then automatically included directly before the main code file, so functions can be called directly from the main edit box.
See our other Plugins here.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon