WordPress.org

Support

Support » Plugins and Hacks » Hacks » Register post status

Register post status

  • I’ve read through the Codex article explaining how to add a post status to WP, and have included the code in my plugin setup. I did it by hand at first, then used the generator:

    function add_whatever_status() {
    	$args = array(
    		'label'                     => _x( 'whatever', 'Status General Name', 'text_domain' ),
    		'label_count'               => _n_noop( 'Whatever (%s)',  'Whatever (%s)', 'text_domain' ),
    		'public'                    => true,
    		'show_in_admin_all_list'    => true,
    		'show_in_admin_status_list' => true,
    		'exclude_from_search'       => false,
    	);
    	register_post_status( 'whatever', $args );
    }
    
    add_action('init', 'add_whatever_status', 0);

    The problem is that the status isn’t appearing on any of the standard dropdowns.

    The Codex gives the tip that “This function does NOT add the registered post status to the admin panel.[…] Consider the action hook post_submitbox_misc_actions for adding this parameter.” What it doesn’t do is provide any useful help – it links straight to the code for that hook.

    Is there a simple function or hook or whatever that will get a custom status in the lists, please?

Viewing 2 replies - 1 through 2 (of 2 total)
  • That action will not help you alter existing form elements, only add additional form elements. Having two different status dropdowns is pretty lame IMO, but that seems to be what the Codex is suggesting. I see no way to add additional statuses to the existing publish box dropdown. I believe the only possibility is to insert the additional statuses using jQuery once the page loads.

    Bah, humbug.

    I had a look at Edit Flow, which does the status list thing. Unfortunately, it doesn’t do the automation I want for my clientele (i.e. click a single button/link to send to new status level), so I ended up building my own post lists and adding links that will kick off php scripts to update status and so on.

    Enormous amount of work involved, especially since the content flow process should be a part of a CMS (in my opinion), but at least it will do precisely what I want!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Register post status’ is closed to new replies.