[wordpress插件] Block Areas街区

wordpress 插件 文章 2020-03-06 12:00 455 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

Introduces a simple method for defining block areas to use the block editor outside of the post content.

介绍一种简单的方法来定义块区域,以在帖子内容之外使用块编辑器。

This is an experimental plugin that explores basic usage of Gutenberg blocks outside of the content bubble, on a sitewide level.

这是一个实验性插件,可在整个站点范围内探索内容泡泡之外的Gutenberg块的基本用法。

In the long term it will likely eliminate itself once WordPress core and Gutenberg will have completed the next phase of advancing to the sitewide level.

从长远来看,一旦WordPress核心和古腾堡(Gutenberg)将完成进入站点级的下一阶段,它很可能会淘汰自己。

The plugin exists as a baseline to have an easy way for experimenting with similar functionality already today.

该插件作为基准存在,可以提供一种简便的方法来试用如今已经存在的类似功能。

Usage

用法

After activating the plugin, you can create and edit block areas under Appearance > Block Areas.

激活插件后,您可以在外观>阻止区域下创建和编辑阻止区域。

There should be two block areas already, header and footer.

应该已经有两个块区域,分别是 header footer

Block areas are identified by their unique slug.

块区域由其唯一的子弹标识。

Since header and footer are expected to exist, make sure not to delete them.

由于预计 header footer 存在,因此请确保不要删除它们。

In order to print a specific block area, for example in your theme, use block_areas()->render( $slug ) (eg block_areas()->render( 'header

为了打印特定的块区域,例如在您的主题中,请使用 block_areas()-> render($ slug)(例如, block_areas()-> render('header

' )).

'))。

You can also explicitly add theme support, specifying which block area slugs your theme relies on (eg add_theme_support( 'block-areas', 'header', 'footer' )).

您还可以显式添加主题支持,指定主题所依赖的块区域(例如 add_theme_support('block-areas','header','footer'))。

>

>

安装步骤

    1. Upload the entire block-areas folder to the /wp-content/plugins/ directory or download it through the WordPress backend.
    2. 将整个 block-areas 文件夹上传到 / wp-content / plugins / 目录,或通过WordPress后端下载。

    3. Activate the plugin through the ‘Plugins’ menu in WordPress.
    4. 通过WordPress中的“插件”菜单激活插件。

下载地址
https://downloads.wordpress.org/plugin/block-areas.0.2.0.zip
-EOF-

AI助手支持GPT4.0