Opened 9 years ago
Closed 9 years ago
#35949 closed enhancement (duplicate)
Default value in `get_post_field`
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | has-patch |
Focuses: | Cc: |
Description
I think that get_post_field() function should have param with default value.
Why ?
For example in feature I can change other functions:
<?php function get_post_mime_type( $ID = '' ) { return get_post_field('post_mime_type', $ID, 'display', false); }
Previous version:
<?php function get_post_mime_type( $ID = '' ) { $post = get_post($ID); if ( is_object($post) ) return $post->post_mime_type; return false; }
Attachments (1)
Note: See
TracTickets for help on using
tickets.
The same was proposed in #34546.