regionhalland / region-halland-plugin-prepare-the-content
前端插件,用于使用id和slug准备'the_content'
v1.10.0
2023-11-15 12:59 UTC
README
如何使用Region Hallands插件"RhPrepareTheContent"
以下是如何使用插件"RhPrepareTheContent"的说明。
用途
此插件为所有h2、h3和h4标题添加id和slug。如果您想构建一个“页面查找”功能,这可能很有用。
许可模型
此插件使用GPL-3.0许可模型。您可以通过随附的文件了解更多关于此许可模型的信息。
LICENSE (https://regionhalland.visualstudio.com/public.RhWpPlugIns/_git/RhPrepareTheContent?path=%2FLICENSE&version=GBmaster)
安装和激活
A) Hämta pluginen via Git eller läs in det med Composer
B) Installera Region Hallands plugin i Wordpress plugin folder
C) Aktivera pluginet inifrån Wordpress admin
通过Git获取插件
git clone https://regionhalland.visualstudio.com/public.RhWpPlugIns/_git/RhPrepareTheContent
通过composer导入插件
注意!确保您获取的是最新版本。
"require": {
"regionhalland/region-halland-plugin-prepare-the-content": "1.0.0"
},
如何在页面上通过"Blade"使用"region-halland-prepare-the-content"
@if(function_exists('get_region_halland_prepare_the_content'))
@php(get_region_halland_prepare_the_content())
@endif
<article class="article">
{!! the_content() !!}
</article>
这将根据以下方式在"the_content"内创建id和slug:
<h2 id="lorem-ipsum-1">Lorem ipsum</h2>
<h3 id="lorem-ipsum-dolares-2">Lorem ipsum dolares</h3>
<h4 id="lorem-integer-metus-3">Lorem integer metus</h4>
版本历史
1.10.0
- 为htmlentities函数添加默认值
1.9.1
- 停止在结束标签上应用ID属性
1.9.0
- 停止在内容上添加p标签
1.8.0
- 从slug中删除" "
- 由于Gutenberg而通过preg_split分割内容
1.7.0
- 从slug中删除","和"."
- 删除空标签
- 从标签中删除html
1.6.0
- 添加用于清除wp-gutenberg注释的功能
1.5.0
- 添加通过Packagist发布的流水线
1.4.0
- 也会删除Gutenberg注释
1.3.0
- 用""替换","和"/"
1.2.1
- 修复了一个与变量的错误
1.2.0
- 在每个slug的末尾添加运行编号
1.1.0
- 更新了关于许可模型的信息
- 附上了许可模型文件
1.0.0
- 第一个版本