前言介紹
- 這款 WordPress 外掛「PHP Execution」是 2009-03-08 上架。 目前已經下架不再更新,不建議安裝使用。
- 目前有 3000 個安裝啟用數。
- 上一次更新是 2009-08-07,距離現在已有 5749 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 2.5 以上版本才可以安裝。
- 有 5 人給過評分。
- 論壇上目前有 1 個提問,問題解答率 0%
外掛協作開發者
nzeh |
外掛標籤
php | run | code | exec | execution |
內容簡介
PHP Execution Plugin 是 WordPress 的外掛程式,允許使用者在其文章和頁面中編寫 PHP 代碼。當文章被顯示時,嵌入的 PHP 代碼將被執行。透過此外掛程式,使用者可以在文章中使用動態內容。
與其他有相同目的的外掛程式相比,此外掛程式與 WordPress 的視覺化編輯器相容。因此,您無需關閉視覺化編輯器即可編輯您的 PHP 代碼。
此外,該外掛程式提供一個管理員區域,讓管理員輕鬆編輯博客用戶的 PHP 執行權限。外掛程式還自動防止沒有 PHP 執行權限的使用者編輯擁有這些權限的其他用戶的文章或頁面。因此,它修復了一個潛在的安全漏洞,即沒有 PHP 執行權限的人仍然可以執行編輯其他使用者文章的代碼。
功能:
在您的文章和頁面(全文,摘要,提要)中執行 PHP 代碼。
與 WordPress 的視覺化編輯器相容。無需關閉它。
在編輯器的 HTML 檢視中使用通常的“”語法來編寫 PHP 代碼塊。
管理員區域可編輯博客用戶的 PHP 執行權限。
外掛程式會自動防止沒有 PHP 執行權限的使用者編輯獲得執行 PHP 代碼權限的其他使用者文章。
此項目現已退出 beta 階段。
更多信息請參閱zehnet.de: PHP Execution Plugin home
編輯 PHP 代碼
可以在編輯器的 HTML 檢視中編輯 PHP 代碼。
以”打頭的 PHP 代碼塊在文章中嵌入方式與您習慣的相同: 要注意的是,修改 PHP 時,不得在代碼塊中的字符串中加入短開放標籤(像這樣:”),否則結束標籤將會被匹配,您的代碼將不可避免地被分割。所以不要寫例如下面的代碼:
some text
" ?>
more text
相較於此,寫 '‘$test = “hello ?>”' 就不會產生任何問題了。
PHP 代碼不在全域範圍內執行。如果您需要訪問全域範圍的變數,首先需要使用 global $var1, $var2;
“導入”他們。
此外掛程式並不針對每個代碼片段進行求職。而是作為一個整體對文章內容進行評估。因此,下列代碼不會產生錯誤:
The test was successful.
The test failed.
在 HTML 檢視和視覺化檢視之間切換時,PHP 代碼不會發生任何改變。您的代碼中的所有 HTML 標籤,空格等其他內容都會被保留。
原文外掛簡介
The PHP Execution Plugin is a WordPress plugin which allows users to write php code inside of their posts and pages. Embedded php code will be executed when the post is shown. In doing so, the plugin offers the possibility to utilize dynamic content inside of posts.
In contrast to other plugins with the same aim, this one integrates well with WordPress’ visual editor. So there is no need to turn off the visual editor in order to edit your php code.
Additionally it provides an admin section which lets administrators edit the blog users’ php execution rights easily. The plugin also automatically prevents users with no php execution rights from editing posts or pages of users with these rights. It thus fixes a possible security leak where people without php execution rights can still execute code with editing other users’ posts.
Features:
executes php code in your posts and pages (full, excerpts, feeds).
integrates well with WordPress’ visual editor. No need to turn it off.
write php code in the usual ” syntax in the html view of the editor.
admin section to edit the blog users’ php execution rights.
plugin automatically prevents users with no php execution rights to edit posts of users with rights to execute php code.
Project was now moved out of beta.
Further information at zehnet.de: PHP Execution Plugin home
Editing PHP code
php code can be edited in the html view of the editor.
php code is embedded into a post in the same way as you are used to: a php block begins with ”. The short open tag, i.e. ”) somewhere inside a string in your php code block. If you do so, this ending delimeter will be matched and your code will inevitably break apart. So don?t write e.g.:
some text
" ?>
more text
Writing ‘$test = “hello ?>”‘ instead will not lead to any problems.
Php code is not executed in the global scope. If you need to gain access to variables in the global scope you need to “import” them first with ‘global $var1, $var2;’.
This plugin does not evaluate every single code snippet, but the content of the post as a whole. So the following lines won?t result in errors:
The test was successful.
The test failed.
When switching between html and visual view the php code is not altered in any case. All html tags, whitespaces etc. in your code are preserved.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「PHP Execution」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
0.9.2 | 0.9.3 | 1.0.0 | 1.0.1 | trunk |
延伸相關外掛(你可能也想知道)
暫無相關外掛推薦。