Skip to content

Latest commit

 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Extended Post Status

Build Status No Maintenance Intended

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 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

About

A library which provides extended functionality to WordPress post type statuses

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages