https://github.com/wpup/extended-post-status
A library which provides extended functionality to WordPress post type statuses
https://github.com/wpup/extended-post-status
Last synced: 9 months ago
JSON representation
A library which provides extended functionality to WordPress post type statuses
- Host: GitHub
- URL: https://github.com/wpup/extended-post-status
- Owner: wpup
- License: mit
- Created: 2016-07-20T17:09:05.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-12-02T14:23:56.000Z (over 6 years ago)
- Last Synced: 2024-04-14T14:49:28.829Z (about 2 years ago)
- Language: PHP
- Homepage:
- Size: 16.6 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Extended Post Status
[](https://travis-ci.org/wpup/extended-post-status)
[](http://unmaintained.tech/)
> Requires PHP 5.5.9
A library which provides extended functionality to WordPress post type statuses.
## Installation
```sh
composer require frozzare/wp-extended-post-status
```
## Example
```php
'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
```php
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 for `register_post_status` plus `post_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 of `singular` and `plural` that is used as names for `label_count` if empty.
Differences from `register_post_status` arguments:
* `public` has `true` as default value instead of `false`
* `show_in_admin_status_list` has `true` as default value instead of `false`
## License
MIT © [Fredrik Forsmo](https://github.com/frozzare)