Skip to:

Opened 10 years ago

Closed 10 years ago

#5518 closed defect (bug) (fixed)

Return results for bp_[update|delete]_option()

Reported by: slaffik's profile slaFFik Owned by: boonebgorges's profile boonebgorges
Milestone: 2.1 Priority: normal
Severity: normal Version: 1.5
Component: Core Keywords: has-patch dev-feedback commit


I'm on BuddyPress beta.
Currently only bp_add_option() return the result of native WordPress function.

Could you please add return for bp_update_option() and bp_delete_option() as well?

Thanks in advance.

Attachments (1)

bp-core-options.php.patch (1.2 KB) - added by slaFFik 10 years ago.

Download all attachments as: .zip

Change History (8)

#1 @slaFFik
10 years ago

I see that you already using this like this:

if ( !bp_update_option( $key, $bp->site_options[ $key ] ) ) {
    $errors = true;

But this results in errors in PHPStorm, as nothing explicitly returned but the function.

#2 @boonebgorges
10 years ago

  • Milestone changed from 2.0 to 2.1

Yes, let's do this, but it's late to do it for BP 2.0.

#3 @slaFFik
10 years ago

1.9.3? I see 2 tickets closed there :)

Anyway, thanks for accepting.

#4 follow-up: @boonebgorges
10 years ago

  • Version changed from 2.0 to 1.5

These functions have acted this way since they were introduced in BP 1.5, so the issue you raise is not a regression in 2.0. And while it's very unlikely that adding return values is going to break anything, it's not impossible. And it's unwise to make changes with breaking potential at this point in the dev cycle (for either 2.0 or 1.9.x) for non-regressions. Thus the 2.1 milestone :)

#5 in reply to: ↑ 4 @slaFFik
10 years ago

You won. Hat's off

#6 @DJPaul
10 years ago

  • Keywords dev-feedback commit added

Patch is OK assuming we are fine changing the return types.

#7 @boonebgorges
10 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 8668:

Return values from bp_*_option() functions.

Fixes #5518

Props slaFFik

Note: See TracTickets for help on using tickets.