[wp-trac] [WordPress Trac] #23207: Add $labels argument to register_post_status() (was: Add $labes argument to register_post_status())
WordPress Trac
noreply at wordpress.org
Tue Jan 15 23:40:11 UTC 2013
#23207: Add $labels argument to register_post_status()
-------------------------+------------------------------
Reporter: ramiy | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Post Types | Version: 3.5
Severity: normal | Resolution:
Keywords: |
-------------------------+------------------------------
Description changed by SergeyBiryukov:
Old 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 );
> }}}
New description:
WordPress functions '''register_taxonomy()''' and
'''register_post_type()''' has '''labels''' argument. Why not add labels
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 );
}}}
--
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23207#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list