-
Notifications
You must be signed in to change notification settings - Fork 0
templates
YanQS edited this page Dec 13, 2025
·
1 revision
-
includes/templates/:插件默认模板文件所在目录(reply.php、new_comment.php、pending.php)。 -
includes/templates/styles/{modern,plain,compact}/:按风格组织的样式模板(每个风格包含对应的模板文件)。
- 管理页面会展示 HTML 编辑器(支持 TinyMCE)。
- “载入所选风格” 会从
includes/templates/styles/<style>/读取对应文件并尝试写入到includes/templates/,若写入失败则保存到pcn_templates选项。 - 保存时:插件会保留模板中包含的 PHP 源代码;但出于安全,后台的“预览”会在渲染前移除 PHP 以避免执行。
- 常用变量:
{{blogname}},{{parent_author}},{{parent_content}},{{reply_author}},{{reply_content}},{{comment_link}},{{unsubscribe_url}}。
- 建议在子主题或版本控制中保存自定义模板。若想禁用样式文件写入,请保证
includes/templates/为只读,这会促使插件使用数据库中的模板备份。