WordPress.org

Make WordPress Core

Opened 15 months ago

Last modified 14 months ago

#23207 new enhancement

Add $labes argument to register_post_status() — at Initial Version

Reported by: ramiy Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.0
Component: Posts, Post Types Keywords: editorial-flow needs-patch
Focuses: Cc:

Description

WordPress functions register_taxonomy() and register_post_type() has labes argument. Why not add labes to register_post_status()?

The current way to add status:

$args = array(
	'label'                     => __( 'draft', 'text_domain' ),
	'label_count'               => _n_noop( 'Draft (%s)',  'Drafts (%s)', 'text_domain' ),
	'public'                    => false,
	'show_in_admin_all_list'    => true,
	'show_in_admin_status_list' => true,
	'exclude_from_search'       => true,
);

register_post_status( 'draft', $args );

The new way (using labels):

$labels = array(
	'name'                      => __( 'Draft', 'text_domain' ),
	'singular_count'            => __( 'Draft (%s)', 'text_domain' ),
	'plural_count'              => __( 'Drafts (%s)', 'text_domain' ),
	'any_other_label'           => __( 'Any Other Label', 'text_domain' )
);
$args = array(
	'labels'                    => $labels,
	'public'                    => false,
	'show_in_admin_all_list'    => true,
	'show_in_admin_status_list' => true,
	'exclude_from_search'       => true,
);

register_post_status( 'draft', $args );

Change History (0)

Note: See TracTickets for help on using tickets.