frozzare / wp-extended-post-status
Extended Post Status for WordPress
Installs: 3 420
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: ^5.5.9 || ^7.0
- composer/installers: ~1.0
Requires (Dev)
- frozzare/wp-test-suite: ~1.0
- wp-coding-standards/wpcs: dev-develop
This package is auto-updated.
Last update: 2024-11-29 04:39:56 UTC
README
Requires PHP 5.5.9
A library which provides extended functionality to WordPress post type statuses.
Installation
composer require frozzare/wp-extended-post-status
Example
<?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' ] );
Documentation
function register_extended_post_status( string $post_status, array $args = [], array $names = [] )
$post_status
is the name of the post status.$args
is a array of arguments for this post status, the same as forregister_post_status
pluspost_type
argument, which should be array or string of post types where post status should be registered ('any' can also be passed).$names
is a array ofsingular
andplural
that is used as names forlabel_count
if empty.
Differences from register_post_status
arguments:
public
hastrue
as default value instead offalse
show_in_admin_status_list
hastrue
as default value instead offalse
License
MIT © Fredrik Forsmo