[wp-trac] [WordPress Trac] #14981: Provide a context for post statuses
WordPress Trac
noreply at wordpress.org
Thu Jan 14 23:55:31 UTC 2016
#14981: Provide a context for post statuses
--------------------------------------+-----------------------------
Reporter: xibe | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: I18N | Version: 3.1
Severity: normal | Resolution:
Keywords: good-first-bug has-patch | Focuses:
--------------------------------------+-----------------------------
Comment (by rockwell15):
Replying to [comment:20 swissspidy]:
> Thanks for the patch, @rockwell15!
>
> Just note that not only the post statuses should be post type labels,
but also the other mentioned strings like `__( 'Search' )`, `__( 'View
All' )` and `__( 'Most Recent' )`.
>
> Also, we usually use yoda conditions, i.e. `if( 'private' ===
$post->post_status ) {...}` instead of `if( $post->post_status ==
'private' ) {...}`
Ok, I'll fix the conditions format.
I didn't add those 3 strings you mentioned to {{{get_post_type_labels()}}}
since those only appear once regarding post type (wp-admin/includes/nav-
menu.php ~ line 382), so I thought it unnecessary for that function to
fetch them every time it is called. You think I should add them to
{{{get_post_type_labels()}}} though?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/14981#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list