PHPackages                             lizus/wp-function - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lizus/wp-function

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lizus/wp-function
=================

wp function

015PHP

Since Jun 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/lizus/wp-function)[ Packagist](https://packagist.org/packages/lizus/wp-function)[ RSS](/packages/lizus-wp-function/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

wp-function
===========

[](#wp-function)

一些方便使用的wp函数

可用函数表 `namespace LizusFunction;`
--------------------------------

[](#可用函数表-namespace-lizusfunction)

- `cut_html($text,$len,$sentence)` &lt;string&gt; - 裁剪html文本至$len长度，并且最多包含$sentence个中文句子，用于输出富文本摘要
- `cut_text($text,$len,$sentence,$dot)` &lt;string&gt; - 裁剪文本至$len长度，并且最多包含$sentence个中文句子，用于输出纯文本摘要
- `get_color($img,$x=5,$y=5)` : &lt;string&gt; - 返回图片某坐标的颜色值如#000000
- `get_current_url()` : &lt;string&gt; - 获取当前页的URL地址，包括$\_GET，但不含hash
- `get_first_letter($str)` &lt;string&gt; - 获取第一个字的拼音首字母
- `get_formatting_content($content)` : &lt;string&gt; - 将内容以文章内容的方式进行处理
- `get_ip_address()` : &lt;string&gt; - 返回客户端IP
- `get_post_types()` &lt;array&gt; - 获取所有可见的文章类型
- `get_rand($min,$max,$num)` : &lt;array&gt; - 生成在$min和$max之间一共$num个随机数
- `get_taxs()` &lt;array&gt; - 获取所有可见的分类类型
- `get_time_ago($agoTime,$dataFormat)` : &lt;string&gt; - 根据过去某一时间相对当前时间的差值来决定如果显示该时间，常用于文章显示发布时间，评论时间等
- `get_transient($key)` &lt;mix&gt; - 获取transient cache,带cache清理判断
- `get_url_last_slash($url)` &lt;string&gt; - 获取url地址最后一个slash的内容
- `get_url_path($url)` : &lt;string&gt; - 获取$url地址的?前的部分
- `get_url_queries($url)` : &lt;array&gt; - 获取$url地址的$\_GET部分
- `get_url_query_val($key,$url)` : &lt;string&gt; - 用于获取地址中的某个参数的值
- `order_clear_cache()` &lt;boolean&gt; - 判断url的query中clear\_cache值是否为ok，用于清理cache
- `parse_url_query($q)` : &lt;array&gt; - 将类似url中的query段字符串格式化为键值对数组,相同键值将只取最后一个值
- `url_remove_page($url)` &lt;string&gt; - 去除url中page段
- `v_key($key,$type)` &lt;string&gt; - 设置自定义key
- `v_url($url,$queries)` : &lt;string&gt; - 拼接url字符串,$queries可以是类似$\_GET的键值对数组或者用&amp;拼接的url查询字符串

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a0aed58fd8cecb60124971238760d453634d22344572f2fc0153d76b935fab9?d=identicon)[lizus](/maintainers/lizus)

---

Top Contributors

[![lizus](https://avatars.githubusercontent.com/u/6037525?v=4)](https://github.com/lizus "lizus (12 commits)")

### Embed Badge

![Health badge](/badges/lizus-wp-function/health.svg)

```
[![Health](https://phpackages.com/badges/lizus-wp-function/health.svg)](https://phpackages.com/packages/lizus-wp-function)
```

###  Alternatives

[elao/accesseo

Provide accessibility and SEO insights of your page in Symfony profiler

299.2k](/packages/elao-accesseo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
