Skip to:
Content

BuddyPress.org

Opened 3 years ago

Closed 2 years ago

#8631 closed enhancement (fixed)

Pass the user ID inside the `bp_core_general_settings_after_save` hook

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

Description

This is a suggestion/request made from this support topic : ​https://buddypress.org/support/topic/suggestion-pass-user_id-to-bp_core_general_settings_after_save/

I see no reason not to do it as we're including this parameter into the bp_core_general_settings_after_save hook.

The attached patch also include some code formatting improvement.

Attachments (1)

8631.patch​ (4.3 KB) - added by imath 3 years ago.

Download all attachments as: .zip

Change History (7)

@imath
3 years ago

#1 @oztaser
3 years ago

I was thinking bp_displayed_user() function could be use for this requirement but also I don't see any blocker about adding parameters in to the action hook.

Your patch looks great to me. I just think we can also add since information about new $redirect_to parameter. Is there any rule about it?

#2 @imath
3 years ago

Hi @oztaser

You're totally right, that's probably why I've improved a bit some other part of the code πŸ˜‰. As we're passing this param into the other hook, let's say we're improving consistency

#3 @alexmangini
3 years ago

Thank you, the patch works great and adds some nice cleanup to the function.

#4 @espellcaste
3 years ago

Curious: Is it a good idea to add a hook (filter) for the $redirect_to URL?

#5 @imath
2 years ago

I think it is πŸ˜‰ A good reason for this is the hard work I had to achieve to regenerate URLs using the WP Rewrite API for the BP Rewrites plugin πŸ˜…

#6 @imath
2 years ago

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

In 13292:

Pass the user ID inside the hook fired after settings are saved

This is a reply to a request made in the BuddyPress support forum. See
[​https://buddypress.org/support/topic/suggestion-pass-user_id-to-bp_core_general_settings_after_save/
this topic] for more information about it.

Props alexmangini, oztaser, espellcaste.

Fixes #8631

--Cette ligne, et les suivantes

ci-dessous, seront ignorΓ©es--

M src/bp-settings/actions/general.php

Note: See TracTickets for help on using tickets.