Opened 10 years ago
Closed 10 years ago
#35949 closed enhancement (duplicate)
Default value in `get_post_field`
| Reported by: | sebastian.pisula | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Posts, Post Types | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
The same was proposed in #34546.