webnuvola/antispambot

WordPress 独立的 antispambot 功能

v1.5.0 2024-03-01 16:46 UTC

This package is auto-updated.

Last update: 2024-08-30 18:02:05 UTC


README

Latest Version on Packagist GitHub Tests Action Status Total Downloads

此包允许您在 WordPress 外部使用 antispambot 功能。

安装

您可以通过 composer 安装此包

composer require webnuvola/antispambot

用法

echo antispambot('demo@example.com');
// Example output: <a href="mailto:dem&#111;&#64;exa&#109;p&#108;&#101;.&#99;o&#109;">de&#109;&#111;&#64;e&#120;ample&#46;&#99;om</a>
// Example output decoded: <a href="mailto:demo@example.com">demo@example.com</a>

echo antispambot('demo@example.com', 'Contact us');
// Example output: <a href="mailto:&#105;&#110;fo&#64;ex&#97;&#109;&#112;&#108;e&#46;co&#109;">Contact us</a>

echo antispambot('demo@example.com', 'Contact us', ['class' => 'text-white', 'target' => '_blank']);
// Example output: <a href="mailto:&#105;&#110;&#102;o&#64;e&#120;&#97;&#109;ple.&#99;&#111;&#109;" class="text-white" target="_blank">Contact us</a>

echo \Webnuvola\Antispambot\Antispambot::antispambot('demo@example.com');
// Example output: &#100;&#101;&#109;&#111;&#64;e&#120;a&#109;pl&#101;&#46;co&#109;

使用 antispambot_html 函数返回一个 Illuminate\Support\HtmlString 实例,用于与 Laravel 框架一起使用。

文档

antispambotWordPress 开发者资源 中。

测试

composer test

致谢

许可证

本软件根据 GPL v2 发布。有关更多信息,请参阅 LICENSE 文件。