#6497 closed enhancement (fixed)
Missing action hook inside Login widget's login form
Reported by: | Owned by: | r-a-y | |
---|---|---|---|
Milestone: | 2.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Core | Keywords: | has-patch good-first-bug commit |
Cc: | markusweser@… |
Description
Greetings,
in wp-core-widgets.php, besides bp_{before,after}_login_widget_loggedout
, we should have another action hook available inside the login form, like bp_login_widget_login_form
- just as applied within the good ol' BP Default theme.
That enables us to apply some sweet magic, like
<?php /** * Adds a hidden "redirect_to" input field to the login widget form as applied * within BP Default theme * * Taken from buddypress/bp-themes/bp-default/functions.php's function * bp_dtheme_sidebar_login_redirect_to * * Action hook bp_login_widget_login_form is located in * buddypress/bp-core/bp-core-widgets.php */ function bp_login_widget_redirect_to() { $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''; $redirect_to = apply_filters( 'bp_no_access_redirect', $redirect_to ); ?> <input type="hidden" name="redirect_to" value="<?php echo esc_url( $redirect_to ); ?>" /> <?php } add_action( 'bp_login_widget_login_form', 'bp_login_widget_redirect_to' );
Please find my appropriate patch for wp-core-widgets.php attached. I'd appreciate to see it in the next release ;)
Thank you all!
Attachments (1)
Change History (9)
#1
@
9 years ago
- Milestone changed from Awaiting Review to 2.4
Sure, we can add more actions here. Thanks for the patch!
#3
@
9 years ago
- Keywords good-first-bug added
Let's get this in -- we just need to check the name of the action is consistent with any other actions in nearby/related functions, and update the @since
version number for 2.4.
Created action hook bp_login_widget_login_form as applied in BP Default theme