[wordpress插件] Cleancut整洁

wordpress 插件 文章 2020-03-24 13:50 484 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

A couple of simple php functions that, when passed a string of text and a length value, strips the text of html tags and markup, and cuts it to the specified length.

几个简单的PHP函数,当传递一个字符串和一个长度值时,会剥离html标记和标记的文本,并将其剪切为指定的长度。

clencut_w returns the given number of words or less, cleancut_c returns given number of characters or less.

clencut_w返回给定的字符数或更少,cleancut_c返回给定的字符数或更少。

Only complete words are returned.

仅返回完整的单词。

They can be called as cleancut_w($string,$length) and cleancut_c($string,$length=50) from any template file.

在任何模板文件中,它们都可以称为 cleancut_w($ string,$ length) cleancut_c($ string,$ length = 50)

Example:

示例: <?php $ text_clean = cleancut_w($ sometext,50);

echo $text_clean;

echo $ text_clean;

?>.

?>

安装步骤

    1. Copy cct_cleancut.php to the /wp-content/plugins/ directory.
    2. cct_cleancut.php 复制到 / wp-content / plugins / 目录。

    3. Activate it.
    4. 激活它。

    5. Now you can use cleancut_w($string,$length) and cleancut_c($string,$length=50) in your templates.
    6. 现在,您可以在模板中使用 cleancut_w($ string,$ length) cleancut_c($ string,$ length = 50)

下载地址
https://downloads.wordpress.org/plugin/cleancut.1.2.0.zip
-EOF-

AI助手支持GPT4.0