Title: Editor for Timber
Author: dweipert
Published: <strong>2020 年 10 月 29 日</strong>
Last modified: 2020 年 12 月 16 日

---

搜索插件

![](https://ps.w.org/editor-for-timber/assets/banner-772x250.jpg?rev=2411861)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/editor-for-timber/assets/icon-128x128.png?rev=2411861)

# Editor for Timber

 作者：[dweipert](https://profiles.wordpress.org/drogueronin/)

[下载](https://downloads.wordpress.org/plugin/editor-for-timber.1.0.2.zip)

 * [详情](https://cn.wordpress.org/plugins/editor-for-timber/#description)
 * [评价](https://cn.wordpress.org/plugins/editor-for-timber/#reviews)
 * [开发进展](https://cn.wordpress.org/plugins/editor-for-timber/#developers)

 [支持](https://wordpress.org/support/plugin/editor-for-timber/)

## 描述

### Features

 * adds a metabox to configurable Post-Types to create and edit Twig templates
 * adds Twig support to the WP Theme & Plugin editors
    - you can even customize the CodeMirror theme

### Plugin Dependencies

 * https://wordpress.org/plugins/timber-library/
 * https://wordpress.org/plugins/classic-editor/

### How to use the MetaBox Feature

The plugin uses the path defined in `Timber::$locations` as the templates path or
falls back to the uploads folder if none is provided.

Either adjust your `Timber::render('page.twig', $context)`-functions like this:

    ```
    $filenames = [TimberEditor::getTemplateFilename(), 'page.twig'];
    Timber::render($filenames, $context);
    ```

like this

    ```
    TimberEditor::render('page.twig', $context);
    # 'page.twig' serves as a fallback if the current posts's template doesn't exist
    ```

or like this

    ```
    TimberEditor::renderPost('page.twig', $context);
    # renderPost() automatically adds ['post' => new Timber\Post()] to the $context
    ```

## 评价

此插件暂无评价。

## 贡献者及开发者

「Editor for Timber」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ dweipert ](https://profiles.wordpress.org/drogueronin/)

「Editor for Timber」插件已被翻译至 1 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/editor-for-timber/contributors)
为本插件所做的贡献。

[帮助将「Editor for Timber」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/editor-for-timber)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/editor-for-timber/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/editor-for-timber/)，或通过[RSS](https://plugins.trac.wordpress.org/log/editor-for-timber/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/editor-for-timber/)。

## 额外信息

 *  版本 **1.0.2**
 *  最后更新：**5 年前**
 *  活跃安装数量 **50+**
 *  WordPress 版本 ** 5.5 或更高版本 **
 *  已测试的最高版本为 **5.5.18**
 *  PHP 版本 ** 7.4 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/editor-for-timber/) 和 [German](https://de.wordpress.org/plugins/editor-for-timber/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/editor-for-timber)
 * 标签
 * [templates](https://cn.wordpress.org/plugins/tags/templates/)[Timber](https://cn.wordpress.org/plugins/tags/timber/)
   [twig](https://cn.wordpress.org/plugins/tags/twig/)
 *  [高级视图](https://cn.wordpress.org/plugins/editor-for-timber/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/editor-for-timber/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/editor-for-timber/reviews/)

## 贡献者

 *   [ dweipert ](https://profiles.wordpress.org/drogueronin/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/editor-for-timber/)