Skip to:
Content

BuddyPress.org

Changes between Initial Version and Version 1 of Ticket #4636, comment 7


Ignore:
Timestamp:
05/13/2013 11:42:49 AM (7 years ago)
Author:
boonebgorges
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4636, comment 7

    initial v1  
    33In general, I'm a big fan of returning `WP_Error` objects rather than a dummy `false` value. It's possible (however unlikely) that changing the return value of these functions will break something else, though. For example, if someone runs a check like this:
    44
    5 `$success = xprofile_set_field_data( $foo, $bar, $baz );
     5{{{
     6$success = xprofile_set_field_data( $foo, $bar, $baz );
    67if ( false === $success ) { // or even ! $success
    78   echo 'oh noez';
    8 }`
     9}
     10}}}
    911
    1012It's fairly unlikely that we're doing anything like this in BuddyPress, but could you please grep through the codebase to be sure? It's almost certain that we'll cause problems with at least some plugins, but IMO it's worth it in this case, because the `WP_Error` objects are just so much better (though I'd like to hear another dev chime in with an opinion on that).