id summary reporter owner description type status priority milestone component version severity resolution keywords cc focuses
14302 Post object property getters and setters filosofo filosofo "Currently, if you want to get or set a post object's property:
* You have to know which database table it's located in
* If that property is in the posts table, you have to set all properties to set any, via `wp_update_post` or `wp_insert_post`.
* If that property is in the postmeta table, you have to specify that it be returned as a singular value (instead of an array of values)
My patch lets WP figure out where a particular value is stored, so you don't have to, with two new functions:
mixed '''get_post_property''' ( int ''$object_id'', string ''$prop_name'' [, bool ''$force_single'' ] )
bool '''set_post_property''' ( int ''$object_id'', string ''$prop_name'', mixed ''$prop_value'' )" enhancement closed normal Posts, Post Types 3.0 normal duplicate has-patch dev-feedback