Skip to:
Content

BuddyPress.org

Opened 3 years ago

Closed 2 years ago

#8635 closed defect (bug) (fixed)

Remove unnecessary arguments in various function calls

Reported by: oztaser's profile oztaser Owned by: imath's profile imath
Milestone: 11.0.0 Priority: normal
Severity: normal Version:
Component: Core Keywords: has-patch commit
Cc:

Description

I've found a few function call with more arguments than expected. It would be good if we remove them.

Attachments (4)

8635.1.diff (2.6 KB) - added by oztaser 3 years ago.
bp_core_get_userlink expecting 3 arguments, not 4.
8635.2.diff (810 bytes) - added by oztaser 3 years ago.
bp_is_widget_block_active expecting 2 arguments, not 3
8635.3.diff (1.3 KB) - added by oztaser 3 years ago.
We don't need to pass any arguments to these functions.
8635.4.diff (3.5 KB) - added by oztaser 3 years ago.
has_action expecting 2 arguments, not 3.

Download all attachments as: .zip

Change History (11)

@oztaser
3 years ago

bp_core_get_userlink expecting 3 arguments, not 4.

@oztaser
3 years ago

bp_is_widget_block_active expecting 2 arguments, not 3

@oztaser
3 years ago

We don't need to pass any arguments to these functions.

#1 @imath
3 years ago

  • Keywords has-patch commit added
  • Milestone changed from Awaiting Review to 11.0.0

Good catches! Thanks a lot for these improvements.

@oztaser
3 years ago

has_action expecting 2 arguments, not 3.

#2 @espellcaste
3 years ago

All patches are good except for 8635.4.diff It is my understanding those priorities were decreased for a reason.

#3 @imath
2 years ago

@oztaser is right about removing priorities as WordPress do not use it for has_action(). See https://developer.wordpress.org/reference/functions/has_action/

I’ll commit the patches shortly.

#4 @imath
2 years ago

In 13293:

Remove unnecessary 4th argument when using bp_core_get_userlink()

bp_core_get_userlink() only accepts 3 arguments.

Props oztaser

See #8635

#5 @imath
2 years ago

In 13294:

Remove unnecessary 3rd arg when using bp_is_widget_block_active()

bp_is_widget_block_active() only accepts 2 arguments.

Props oztaser

See #8635

#6 @imath
2 years ago

In 13295:

Remove unnecessary arg when using functions which don't expect one

bp_get_message_thread_unread_count() & bp_messages_form_action() do
not accept any arguments.

Props oztaser

See #8635

#7 @imath
2 years ago

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

In 13296:

Remove unnecessary 3rd argument when using has_action()

has_action() only accepts 2 arguments.

Props oztaser

Fixes #8635

Note: See TracTickets for help on using tickets.