PHPackages                             johnbillion/extended-cpts - 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. johnbillion/extended-cpts

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

johnbillion/extended-cpts
=========================

A library which provides extended functionality to WordPress custom post types and taxonomies.

5.1.0(11mo ago)1.0k1.8M—0.7%92[23 issues](https://github.com/johnbillion/extended-cpts/issues)[7 PRs](https://github.com/johnbillion/extended-cpts/pulls)20GPL-2.0-or-laterPHPPHP &gt;= 7.4.0CI passing

Since Nov 4Pushed 8mo ago29 watchersCompare

[ Source](https://github.com/johnbillion/extended-cpts)[ Packagist](https://packagist.org/packages/johnbillion/extended-cpts)[ Docs](https://github.com/johnbillion/extended-cpts/)[ RSS](/packages/johnbillion-extended-cpts/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (15)Versions (51)Used By (20)

[![Build Status](https://camo.githubusercontent.com/08db6cff6096a897a819e0780930dd92326434f354ec7ff658b66b9f835bc13f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6f686e62696c6c696f6e2f657874656e6465642d637074732f696e746567726174696f6e2d74657374732e796d6c3f6272616e63683d646576656c6f70267374796c653d666c61742d737175617265)](https://github.com/johnbillion/extended-cpts/actions)[![Stable Release](https://camo.githubusercontent.com/513577fc6e325bf0904dff3330dfe572d8388afb0d1f6e358d35cb7e54668179/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f686e62696c6c696f6e2f657874656e6465642d637074732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/johnbillion/extended-cpts)[![License](https://camo.githubusercontent.com/d12c5217d1ac8d4bc974dd17ba1b6846a40f6485c78dad9b0e5f2cd2bb3dacc8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d47504c5f76322532422d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/johnbillion/extended-cpts/blob/trunk/LICENSE)[![PHP 7 and 8](https://camo.githubusercontent.com/62847ee06344f1e17cf2fa441ee339a391f6cde70331cd8f7e1d446a0b3aaadf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372532302f253230382d626c75652e7376673f7374796c653d666c61742d737175617265)](https://wordpress.org/support/update-php/)[![Documentation](https://camo.githubusercontent.com/65101d7701b3f6889e6f8fe451021d2f365ed9f56c573e5b9e9dde102b7135c4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63756d656e746174696f6e2d77696b692d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/johnbillion/extended-cpts/wiki)

Extended CPTs
=============

[](#extended-cpts)

Extended CPTs is a library which provides extended functionality to WordPress custom post types and taxonomies. This allows developers to quickly build post types and taxonomies without having to write the same code again and again.

Extended CPTs works with both the block editor and the classic editor.

[See the wiki for full documentation.](https://github.com/johnbillion/extended-cpts/wiki)

Not your first time here? See [Recent Changes for Developers](https://github.com/johnbillion/extended-cpts/wiki/Recent-Changes-for-Developers) to see what features are new in recent versions of Extended CPTs.

Improved Defaults for Post Types
--------------------------------

[](#improved-defaults-for-post-types)

- Automatically generated labels and post updated messages (in English)
- Public post type with admin UI and post thumbnails enabled
- Hierarchical with `page` capability type
- Optimal admin menu placement

Improved Defaults for Taxonomies
--------------------------------

[](#improved-defaults-for-taxonomies)

- Automatically generated labels and term updated messages (in English)
- Hierarchical public taxonomy with admin UI enabled

Extended Admin Features
-----------------------

[](#extended-admin-features)

- Declarative creation of table columns on the post type listing screen:
    - Columns for post meta, taxonomy terms, featured images, post fields, [Posts 2 Posts](https://wordpress.org/plugins/posts-to-posts/) connections, and custom functions
    - Sortable columns for post meta, taxonomy terms, and post fields
    - User capability restrictions
    - Default sort column and sort order
- Declarative creation of table columns on the taxonomy term listing screen:
    - Columns for term meta and custom functions
    - User capability restrictions
- Filter controls on the post type listing screen to enable filtering posts by post meta, taxonomy terms, post author, and post dates
- Override the 'Featured Image' and 'Enter title here' text
- Several custom meta boxes available for taxonomies on the post editing screen:
    - Simplified list of checkboxes
    - Radio buttons
    - Dropdown menu
    - Custom function
- Post types and taxonomies automatically added to the 'At a Glance' section on the dashboard
- Post types optionally added to the 'Recently Published' section on the dashboard

Extended Front-end Features for Post Types
------------------------------------------

[](#extended-front-end-features-for-post-types)

- Specify a custom permalink structure:
    - For example `reviews/%year%/%month%/%review%`
    - Supports all relevant rewrite tags including dates and custom taxonomies
    - Automatic integration with the [Rewrite Rule Testing](https://wordpress.org/plugins/rewrite-testing/) plugin
- Specify public query vars which enable filtering by post meta and post dates
- Specify public query vars which enable sorting by post meta, taxonomy terms, and post fields
- Override default public or private query vars such as `posts_per_page`, `orderby`, `order`, and `nopaging`
- Add the post type to the site's main RSS feed

Minimum Requirements
--------------------

[](#minimum-requirements)

- **PHP:** 7.4
    - Tested up to PHP 8.4
- **WordPress:** 6.0
    - Tested up to WP 6.8

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

[](#installation)

Extended CPTs is a developer library, not a plugin, which means you need to include it as a dependency in your project. Install it using Composer:

```
composer require johnbillion/extended-cpts
```

Other means of installation or usage, particularly bundling within a plugin, is not officially supported and done at your own risk.

Usage
-----

[](#usage)

Need a simple post type with no frills? You can register a post type with a single parameter:

```
add_action( 'init', function() {
	register_extended_post_type( 'article' );
} );
```

And you can register a taxonomy with just two parameters:

```
add_action( 'init', function() {
	register_extended_taxonomy( 'location', 'article' );
} );
```

Try it. You'll have a hierarchical public post type with an admin UI, a hierarchical public taxonomy with an admin UI, and all the labels and updated messages for them will be automatically generated.

Or for a bit more functionality:

```
add_action( 'init', function() {
	register_extended_post_type( 'story', [

		# Add the post type to the site's main RSS feed:
		'show_in_feed' => true,

		# Show all posts on the post type archive:
		'archive' => [
			'nopaging' => true,
		],

		# Add some custom columns to the admin screen:
		'admin_cols' => [
			'story_featured_image' => [
				'title'          => 'Illustration',
				'featured_image' => 'thumbnail'
			],
			'story_published' => [
				'title_icon'  => 'dashicons-calendar-alt',
				'meta_key'    => 'published_date',
				'date_format' => 'd/m/Y'
			],
			'story_genre' => [
				'taxonomy' => 'genre'
			],
		],

		# Add some dropdown filters to the admin screen:
		'admin_filters' => [
			'story_genre' => [
				'taxonomy' => 'genre'
			],
			'story_rating' => [
				'meta_key' => 'star_rating',
			],
		],

	], [

		# Override the base names used for labels:
		'singular' => 'Story',
		'plural'   => 'Stories',
		'slug'     => 'stories',

	] );

	register_extended_taxonomy( 'genre', 'story', [

		# Use radio buttons in the meta box for this taxonomy on the post editing screen:
		'meta_box' => 'radio',

		# Add a custom column to the admin screen:
		'admin_cols' => [
			'updated' => [
				'title_cb'    => function() {
					return 'Last Updated';
				},
				'meta_key'    => 'updated_date',
				'date_format' => 'd/m/Y'
			],
		],

	] );
} );
```

Bam, we now have:

- A 'Stories' post type, with correctly generated labels and post updated messages, three custom columns in the admin area (two of which are sortable), stories added to the main RSS feed, and all stories displayed on the post type archive.
- A 'Genre' taxonomy attached to the 'Stories' post type, with correctly generated labels and term updated messages, and a custom column in the admin area.

The `register_extended_post_type()` and `register_extended_taxonomy()` functions are ultimately wrappers for the `register_post_type()` and `register_taxonomy()` functions in WordPress core, so any of the parameters from those functions can be used.

There's quite a bit more you can do. [See the wiki for full documentation.](https://github.com/johnbillion/extended-cpts/wiki)

Sponsors
--------

[](#sponsors)

The time that I spend maintaining this library and others is in part sponsored by:

[![Automattic](https://camo.githubusercontent.com/b772ed2bbb2f490e5cf6117b2cdfea077c3949279bf5c48dbbeaaf2215c925dd/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f6a6f686e62696c6c696f6e2f6a6f686e62696c6c696f6e406c61746573742f6173736574732f73706f6e736f72732f6175746f6d61747469632e737667)](https://automattic.com)

[![ServMask](https://camo.githubusercontent.com/9d9e5722a5e02afaed959c20a630979fb55fa9e64bf62b38ac61d78242c7d3c1/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f6a6f686e62696c6c696f6e2f6a6f686e62696c6c696f6e406c61746573742f6173736574732f73706f6e736f72732f736572766d61736b2e737667)](https://servmask.com)

Plus all my kind sponsors on GitHub:

[![Sponsors](https://camo.githubusercontent.com/f21a9d0b4d63cceec70d4ceda15b47d46f71bd0a64d2932a05f83d9dd529910f/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f6a6f686e62696c6c696f6e2f6a6f686e62696c6c696f6e406c61746573742f73706f6e736f72732e737667)](https://github.com/sponsors/johnbillion)

[Click here to find out about supporting my open source tools and plugins](https://github.com/sponsors/johnbillion).

Contributing and Testing
------------------------

[](#contributing-and-testing)

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for information on contributing.

License: GPLv2 or later
-----------------------

[](#license-gplv2-or-later)

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance56

Moderate activity, may be stable

Popularity64

Solid adoption and visibility

Community44

Growing community involvement

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 93.1% 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 ~90 days

Recently: every ~65 days

Total

48

Last Release

334d ago

Major Versions

2.5.2 → 3.0.02015-12-20

3.2.1 → 4.0.02017-08-28

4.5.2 → 5.0.02022-01-20

PHP version history (5 changes)2.5PHP &gt;=5.4

4.0.0PHP &gt;=7.0

4.1.0PHP ^7.0

4.5.0PHP ^7 | ^8

5.0.0PHP &gt;= 7.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/208434?v=4)[John Blackbourn](/maintainers/johnbillion)[@johnbillion](https://github.com/johnbillion)

---

Top Contributors

[![johnbillion](https://avatars.githubusercontent.com/u/208434?v=4)](https://github.com/johnbillion "johnbillion (728 commits)")[![vinkla](https://avatars.githubusercontent.com/u/499192?v=4)](https://github.com/vinkla "vinkla (10 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (7 commits)")[![chrillep](https://avatars.githubusercontent.com/u/1267931?v=4)](https://github.com/chrillep "chrillep (7 commits)")[![nlemoine](https://avatars.githubusercontent.com/u/2526939?v=4)](https://github.com/nlemoine "nlemoine (6 commits)")[![claytoncollie](https://avatars.githubusercontent.com/u/4236538?v=4)](https://github.com/claytoncollie "claytoncollie (4 commits)")[![carmoreira](https://avatars.githubusercontent.com/u/2347807?v=4)](https://github.com/carmoreira "carmoreira (3 commits)")[![defunctl](https://avatars.githubusercontent.com/u/1066195?v=4)](https://github.com/defunctl "defunctl (3 commits)")[![spacedmonkey](https://avatars.githubusercontent.com/u/237508?v=4)](https://github.com/spacedmonkey "spacedmonkey (2 commits)")[![runofthemill](https://avatars.githubusercontent.com/u/8418440?v=4)](https://github.com/runofthemill "runofthemill (1 commits)")[![simonwheatley](https://avatars.githubusercontent.com/u/233434?v=4)](https://github.com/simonwheatley "simonwheatley (1 commits)")[![aaronjorbin](https://avatars.githubusercontent.com/u/622599?v=4)](https://github.com/aaronjorbin "aaronjorbin (1 commits)")[![wanacode](https://avatars.githubusercontent.com/u/2317149?v=4)](https://github.com/wanacode "wanacode (1 commits)")[![astratagem](https://avatars.githubusercontent.com/u/1757914?v=4)](https://github.com/astratagem "astratagem (1 commits)")[![BrianHenryIE](https://avatars.githubusercontent.com/u/4720401?v=4)](https://github.com/BrianHenryIE "BrianHenryIE (1 commits)")[![danielhomer](https://avatars.githubusercontent.com/u/1496903?v=4)](https://github.com/danielhomer "danielhomer (1 commits)")[![ggwicz](https://avatars.githubusercontent.com/u/875201?v=4)](https://github.com/ggwicz "ggwicz (1 commits)")[![jazbek](https://avatars.githubusercontent.com/u/434024?v=4)](https://github.com/jazbek "jazbek (1 commits)")[![JoeCrescoll](https://avatars.githubusercontent.com/u/14929732?v=4)](https://github.com/JoeCrescoll "JoeCrescoll (1 commits)")[![PatelUtkarsh](https://avatars.githubusercontent.com/u/5015489?v=4)](https://github.com/PatelUtkarsh "PatelUtkarsh (1 commits)")

---

Tags

maintainer-wantedwordpress

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/johnbillion-extended-cpts/health.svg)

```
[![Health](https://phpackages.com/badges/johnbillion-extended-cpts/health.svg)](https://phpackages.com/packages/johnbillion-extended-cpts)
```

###  Alternatives

[thefrosty/wp-utilities

A library containing my standard development resources

1715.7k15](/packages/thefrosty-wp-utilities)

PHPackages © 2026

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