PHPackages                             waughj/wp-post-link - 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. waughj/wp-post-link

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

waughj/wp-post-link
===================

A simpler way to get link HTML by passing a post slug, ID, or WP\_Post object.

v0.2.8(6y ago)0841AGPL-3.0-or-laterPHPPHP &gt;=7.0

Since Jun 4Pushed 6y agoCompare

[ Source](https://github.com/waughjai/wp-post-link)[ Packagist](https://packagist.org/packages/waughj/wp-post-link)[ RSS](/packages/waughj-wp-post-link/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (3)Versions (11)Used By (1)

WP Post Link
============

[](#wp-post-link)

A simpler way to get link HTML by passing a post slug, ID, or WP\_Post object.

Example
-------

[](#example)

Get post by slug:

```
use WaughJ\WPPostLink\WPPostLink;
$link = new WPPostLink([ 'slug' => 'contact-us' ]);
echo $link;

```

Changelog
---------

[](#changelog)

### 0.2.8

[](#028)

- Fix getting post by slug so that it works for children of other pages
    - Previous version using slug inadvertedly seeked page by path, not slug. Now using a slug seeks by slug specifically

### 0.2.7

[](#027)

- Update TestHashItem dependency

### 0.2.6

[](#026)

- Make compatible with WordPress plugin rules

### 0.2.5

[](#025)

- Make compatible with WordPress plugin rules

### 0.2.4

[](#024)

- Make compatible with WordPress

### 0.2.3

[](#023)

- Make compatible with WordPress plugin rules

### 0.2.2

[](#022)

- Make default post\_type mo' inclusive
    - Make default post\_type mo' inclusive so that it includes all types o' posts 'stead o' just pages.

### 0.2.1

[](#021)

- Incorporate bugfix from HTMLLink

### 0.2.0

[](#020)

- Add PostType

### 0.1.0

[](#010)

- Create initial usable release

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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.

###  Release Activity

Cadence

Every ~26 days

Recently: every ~59 days

Total

10

Last Release

2299d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11161078?v=4)[waughj](/maintainers/waughj)[@waughj](https://github.com/waughj)

---

Tags

wordpresslinkhtmlpost

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/waughj-wp-post-link/health.svg)

```
[![Health](https://phpackages.com/badges/waughj-wp-post-link/health.svg)](https://phpackages.com/packages/waughj-wp-post-link)
```

###  Alternatives

[webdevstudios/cmb2-attached-posts

Custom field for CMB2 for creating post relationships.

13565.5k](/packages/webdevstudios-cmb2-attached-posts)[alexis-magina/cmb2-field-post-search-ajax

CMB2 field type to attach posts to each others. Search with Ajax.

3913.4k1](/packages/alexis-magina-cmb2-field-post-search-ajax)[wpbp/cpt_columns

Improve the CPT list in the backend for your CPTs

218.3k](/packages/wpbp-cpt-columns)

PHPackages © 2026

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