WordPress.org

Make WordPress Core

Changes between Initial Version and Version 3 of Ticket #14302


Ignore:
Timestamp:
07/18/10 01:28:26 (4 years ago)
Author:
filosofo
Comment:

I think you're right that it makes more sense to call them get_post_property and set_post_property, in light of the other objects throughout WP (in the PHP sense of "object"), such as the taxonomy and user objects.

Since the advent of the current taxonomy system I've preferred thinking of posts in general as objects, but the naming conventions introduced in 3.0 suggest that I need to stop worrying and love the "post."

Second patch uses *_post_* instead of *_object_*

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14302

    • Property Owner set to filosofo
    • Property Status changed from new to accepted
  • Ticket #14302 – Description

    initial v3  
    66My patch lets WP figure out where a particular value is stored, so you don't have to, with two new functions: 
    77 
    8 mixed '''get_object_property''' ( int ''$object_id'', string ''$prop_name'' [, bool ''$force_single'' ] ) 
     8mixed '''get_post_property''' ( int ''$object_id'', string ''$prop_name'' [, bool ''$force_single'' ] ) 
    99 
    10 bool '''set_object_property''' ( int ''$object_id'', string ''$prop_name'', mixed ''$prop_value'' ) 
     10bool '''set_post_property''' ( int ''$object_id'', string ''$prop_name'', mixed ''$prop_value'' )