PHPackages                             elcontraption/wp-post-type - 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. elcontraption/wp-post-type

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

elcontraption/wp-post-type
==========================

A WordPress custom post type creator class.

0.2.0(11y ago)2442MITPHPPHP &gt;=5.4.0

Since Mar 19Pushed 11y ago1 watchersCompare

[ Source](https://github.com/elcontraption/wp-post-type)[ Packagist](https://packagist.org/packages/elcontraption/wp-post-type)[ RSS](/packages/elcontraption-wp-post-type/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

WP Post Type
============

[](#wp-post-type)

A WordPress custom post type creator class.

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

[](#installation)

Via composer:

```
composer require elcontraption/wp-post-type

```

Create a post type
------------------

[](#create-a-post-type)

Create an 'event' post type:

```
use \ElContraption\WpPostType\PostType;

$events = new PostType('event');
```

The first argument may either be a string representing the name of the post type (typically singular), or an array defining `singular`, and `plural` names:

```
$events = new PostType(array(

    // These are required when passing an array for the first parameter
    'singular' => 'Gallery',
    'plural' => 'Galleries',

    // Optional
    'name' => 'gallery'
));
```

Labels
------

[](#labels)

Labels are assigned based on the singular and plural names. You may override any post type label by passing an array of labels for the second parameter:

```
$labels = array(

    // Override the 'add_new' label
    'add_new' => 'My Custom Label'
);

$events = new PostType('event', $labels);
```

Arguments
---------

[](#arguments)

The default WordPress post type arguments are respected, which means your custom post type will not be public by default [see defaults](https://codex.wordpress.org/Function_Reference/register_post_type#arguments). You may set your own arguments by passing an array for the third parameter:

```
$args = array(

    // Make this post type public
    'public' => true
);

$events = new PostType('event', $labels, $args);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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 ~3 days

Total

3

Last Release

4073d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/67c2148e71cf45c053ed2dc8adfdb4c41188f52c732b9e48e5d9304714d6449f?d=identicon)[elcontraption](/maintainers/elcontraption)

---

Top Contributors

[![elcontraption](https://avatars.githubusercontent.com/u/33114?v=4)](https://github.com/elcontraption "elcontraption (5 commits)")

### Embed Badge

![Health badge](/badges/elcontraption-wp-post-type/health.svg)

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

###  Alternatives

[fullcalendar/fullcalendar-scheduler

A premium add-on to FullCalendar for displaying events and resources

78514.7k](/packages/fullcalendar-fullcalendar-scheduler)

PHPackages © 2026

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