Requires PHP 5.5.9
A library which provides extended functionality to WordPress post type statuses.
composer require frozzare/wp-extended-post-status<?php
// Register `old` status.
register_extended_post_status( 'old', [], [
'singular' => 'Old'
] );
// Register `obsolete` status.
register_extended_post_status( 'obsolete', [
// Array or string of post types where post status should be registered
'post_type' => ['post', 'page']
], [
'singular' => 'Obsolete'
] );function register_extended_post_status( string $post_status, array $args = [], array $names = [] )$post_statusis the name of the post status.$argsis a array of arguments for this post status, the same as forregister_post_statuspluspost_typeargument, which should be array or string of post types where post status should be registered ('any' can also be passed).$namesis a array ofsingularandpluralthat is used as names forlabel_countif empty.
Differences from register_post_status arguments:
publichastrueas default value instead offalseshow_in_admin_status_listhastrueas default value instead offalse
MIT © Fredrik Forsmo