Skip to content

Instantly share code, notes, and snippets.

@pippinsplugins
Created October 9, 2012 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pippinsplugins/3860317 to your computer and use it in GitHub Desktop.
Save pippinsplugins/3860317 to your computer and use it in GitHub Desktop.
Custom RCP Login Form Short Code to Redirect User to Previous Pag
// user login form
function pw_rcp_login_form( $atts, $content = null ) {
global $post;
$prev_page = $_SERVER['HTTP_REFERER'];
extract( shortcode_atts( array(
'redirect' => $prev_page,
'class' => 'rcp_form'
), $atts ) );
$output = '';
global $rcp_load_css;
// set this to true so the CSS is loaded
$rcp_load_css = true;
$output = rcp_login_form_fields( array( 'redirect' => $redirect, 'class' => $class ) );
return $output;
}
remove_shortcode( 'login_form', 'rcp_login_form' );
add_shortcode( 'login_form', 'pw_rcp_login_form' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment