PHP code example of frozzare / wp-extended-post-status

1. Go to this page and download the library: Download frozzare/wp-extended-post-status library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

frozzare / wp-extended-post-status example snippets




// 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 = [] )