Title: Code Injection
Author: Arman Afzal
Published: <strong>2019 年 2 月 14 日</strong>
Last modified: 2023 年 11 月 11 日

---

搜尋外掛

![](https://ps.w.org/code-injection/assets/banner-772x250.png?rev=2994464)

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://ps.w.org/code-injection/assets/icon.svg?rev=2994464)

# Code Injection

 由 [Arman Afzal](https://profiles.wordpress.org/rmanaf/) 開發

[下載](https://downloads.wordpress.org/plugin/code-injection.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/code-injection/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/code-injection/#reviews)
 * [開發資訊](https://tw.wordpress.org/plugins/code-injection/#developers)

 [技術支援](https://wordpress.org/support/plugin/code-injection/)

## 外掛說明

This plugin allows you to effortlessly create custom ads for your website. Inject
code snippets in HTML, CSS, and JavaScript, write and run custom plugins on-the-
fly, and take your website’s capabilities to the next level.

#### Usage

To use this plugin, follow these steps:
 * Activate the plugin from the Plugins 
menu in your dashboard. * Click on the Code button in the dashboard menu to create
and manage your code snippets. * To insert a code snippet in your post or page, 
copy the CID (code identifier) from the list and use the shortcode `[inject id='#']`,
where `#` is the CID. * To insert a code snippet in your sidebar, drag and drop 
the CI widget into the desired widget area and select the code snippet from the 
dropdown menu.

#### Advanced Usage

If you want to run PHP scripts in your website, you need to do some extra steps:
*
Go to `Settings > Code` Injection and create a strong activator key. This key will
allow you to run PHP scripts safely and securely. * To insert a PHP script in your
post or page, use the shortcode `[unsafe key='#']`, where `#` is the activator key
you created before. Write your PHP script between the opening and closing tags of
the shortcode. * To run a PHP script as a plugin, check the “as plugin” checkbox
when creating or editing a code snippet. This will execute your PHP script on every
page load.

#### Warning

Be careful when running PHP scripts, as they can cause errors or conflicts with 
other plugins or themes. If you encounter any problems, you can disable the code
snippet from the database by changing its status to “draft” in the wp_posts table.

## 螢幕擷圖

 * [[
 * Code Editor

## 適用於區塊編輯器

這個外掛提供 1 個可供 Gutenberg/區塊編輯器使用的區塊。

 *   Code Injection

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈Code Injection〉的開發相關工作。

參與者

 *   [ Arman Afzal ](https://profiles.wordpress.org/rmanaf/)

[將〈Code Injection〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/code-injection)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/code-injection/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/code-injection/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/code-injection/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/code-injection/)。

## 中繼資料

 *  版本 **2.5.0**
 *  最後更新 **3 年前**
 *  啟用安裝數 **10+**
 *  WordPress 版本需求 ** 4.5.0 或更新版本 **
 *  已測試相容的 WordPress 版本 **6.3.8**
 *  語言
 * [English (US)](https://wordpress.org/plugins/code-injection/)
 * 標籤:
 * [code](https://tw.wordpress.org/plugins/tags/code/)[injection](https://tw.wordpress.org/plugins/tags/injection/)
 *  [進階檢視](https://tw.wordpress.org/plugins/code-injection/advanced/)

## 評分

這個項目尚無任何評論記錄。

[Your review](https://wordpress.org/support/plugin/code-injection/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/code-injection/reviews/)

## 參與者

 *   [ Arman Afzal ](https://profiles.wordpress.org/rmanaf/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/code-injection/)