Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

#5518 closed defect (bug) (fixed)

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

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

Description

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 12 years ago.

Download all attachments as: .zip

Change History (8)

#1 @slaFFik
12 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
12 years ago

  • Milestone 2.02.1

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

#3 @slaFFik
12 years ago

1.9.3? I see 2 tickets closed there :)

Anyway, thanks for accepting.

#4 follow-up: @boonebgorges
12 years ago

  • Version 2.01.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
12 years ago

You won. Hat's off

#6 @DJPaul
12 years ago

  • Keywords dev-feedback commit added

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

#7 @boonebgorges
12 years ago

  • Owner set to boonebgorges
  • Resolutionfixed
  • Status newclosed

In 8668:

Return values from bp_*_option() functions.

Fixes #5518

Props slaFFik

Note: See TracTickets for help on using tickets.