Migrating from v2 to v3
Major Changes
1. Abstract Base Classes & Contracts
Previous PostTypes API
// Import PostTypes.
use PostTypes\PostType;
// Create a book post type.
$books = new PostType( 'book' );
// Hide the date and author columns.
$books->columns()->hide( [ 'date', 'author' ] );
// Set the Books menu icon.
$books->icon( 'dashicons-book-alt' );
// Register the post type to WordPress.
$books->register();New PostType API
2. Options, Labels, and Taxonomies
3. Columns API
Migration Steps
Example v2 vs v3
Additional Notes
Last updated