PHPackages                             underpin/custom-post-type-loader - 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. underpin/custom-post-type-loader

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

underpin/custom-post-type-loader
================================

Custom Post Type Loader for Underpin

1.1.0(4y ago)51572GPL-2.0-or-laterPHP

Since May 9Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Underpin-WP/custom-post-type-loader)[ Packagist](https://packagist.org/packages/underpin/custom-post-type-loader)[ RSS](/packages/underpin-custom-post-type-loader/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

Underpin Custom Post Type Loader
================================

[](#underpin-custom-post-type-loader)

Loader That assists with adding custom Post Types to a WordPress website.

Installation
------------

[](#installation)

### Using Composer

[](#using-composer)

`composer require underpin/custom-post-type-loader`

### Manually

[](#manually)

This plugin uses a built-in autoloader, so as long as it is required *before*Underpin, it should work as-expected.

`require_once(__DIR__ . '/underpin-custom-post-type/custom-post-types.php');`

Setup
-----

[](#setup)

1. Install Underpin. See [Underpin Docs](https://www.github.com/underpin-wp/underpin)
2. Register new custom post types menus as-needed.

Example
-------

[](#example)

A very basic example could look something like this.

```
// Register custom Post Type
underpin()->custom_post_types()->add( 'example_type', [
	'type' => 'example-type', // see register_post_type
	'args' => [ /*...*/ ] // see register_post_type
] );
```

Alternatively, you can extend `Custom_Post_Type` and reference the extended class directly, like so:

```
underpin()->custom_post_types()->add('custom-post-type-key','Namespace\To\Class');
```

Querying
--------

[](#querying)

A Custom Post Type instance includes a method, called `query`, which serves as a wrapper for `new WP_Query`.

This encapsulates queries for this post type in a method, and gives you a place to override exactly *how* this post type is queried, should you decide to extend the class.

```
underpin()->custom_post_types()->get( 'post_type' )->query();
```

Editing Posts
-------------

[](#editing-posts)

Like querying, Custom Post Type instances includes a method called `save` which serves as a wrapper for `wp_insert_post`and `wp_update_post`. It also includes notice-logging so you can track what happens on a request.

This encapsulates save actions for this post type in a set of methods, and gives you a place to override exactly *how*this post type is saved, should you decide to extend the class.

```
underpin()->custom_post_types()->save( [/* see wp_insert_post */] );
```

Deleting Posts
--------------

[](#deleting-posts)

This works in the same way as `save` and `query`. It includes logging, and provides a way to encapsulate the action.

```
underpin()->custom_post_types()->delete( $id, $force_delete );
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~99 days

Total

3

Last Release

1681d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e6206223bd6f2a57b8ac80605b1b5c3521faaec18ad3f20f25fb728a9a13784?d=identicon)[tstandiford](/maintainers/tstandiford)

---

Top Contributors

[![alexstandiford](https://avatars.githubusercontent.com/u/8210827?v=4)](https://github.com/alexstandiford "alexstandiford (19 commits)")

---

Tags

custom-post-typeunderpinwordpress

### Embed Badge

![Health badge](/badges/underpin-custom-post-type-loader/health.svg)

```
[![Health](https://phpackages.com/badges/underpin-custom-post-type-loader/health.svg)](https://phpackages.com/packages/underpin-custom-post-type-loader)
```

PHPackages © 2026

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