Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

TIEro on "Register post status"

$
0
0

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 all articles
Browse latest Browse all 8245

Trending Articles