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)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的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://cn.wordpress.org/plugins/code-injection/#description)
 * [评价](https://cn.wordpress.org/plugins/code-injection/#reviews)
 * [开发进展](https://cn.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 个区块.

 *   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 或更高版本 **
 *  已测试的最高版本为 **6.3.8**
 *  语言
 * [English (US)](https://wordpress.org/plugins/code-injection/)
 * 标签
 * [code](https://cn.wordpress.org/plugins/tags/code/)[injection](https://cn.wordpress.org/plugins/tags/injection/)
 *  [高级视图](https://cn.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/)