跳到内容

PHP Code Widget

v2.4

Samuel Wood (Otto) · 2008年3月20日 上架

Like the Text widget, but also allows working PHP code to be inserted.

正在使用
7 万+
评分
4.7 / 5
累计下载
100 万
最近更新
2022年3月31日
61 条评价需要 WordPress 2.8+已测试到 5.9.21

截图

The widgets screen showing a PHP code widget in use.
The widgets screen showing a PHP code widget in use.
The output of the widget on the site.
The output of the widget on the site.

The normal Text widget allows you to insert arbitrary Text and/or HTML code. This allows that too, but also parses any PHP code in the text widget and executes it.

This can make it easier to migrate to a widget-based theme. However, this plugin should not be used long term, as anybody with access to edit the widgets on your site will be able to execute arbitrary PHP code.

All PHP code must be enclosed in the standard php opening and closing tags ( <?php and ?> ) for it to be recognized and executed.

Only users with the unfiltered_html role will be allowed to insert unfiltered HTML. This includes PHP code, so users without admin or editor permissions will not be able to use this to execute code, even if they have widget editing permissions.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums