Opened 9 years ago
Last modified 6 years ago
#34546 new enhancement
Change in function `get_post_field`
Reported by: | sebastian.pisula | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | |
Focuses: | Cc: |
Description
I suggest change for function get_post_field();
- Second param should be optional;
- Add default value in param of function.
Additional I have question. Why in function get_the_ID() or get_post_title(); don't call function get_post_field ?
In many functions in first line is $post = get_post( $post );
If we insert my patch then we can use:
function get_the_ID() { return get_post_field('ID', null, 'display', false); }
OR
function get_the_guid( $id = 0 ) { return apply_filters( 'get_the_guid', get_post_field( 'guid', $id ) ); }
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
#35949 was marked as a duplicate.