Skip to content
Docs
Get RestroPress

Action

rpress_purchase_form_before_register_login

Updated
On this page

Fires before the login and register options are shown to a guest.

Runs in rpress_show_purchase_form() when guests must log in, and in the login and register shortcode templates for guests when the login method is not guest-only. Login providers such as social login plugins hook it to output their buttons. In the login shortcode template the output is captured and only shown if it is not empty.

Example#

function my_social_login_button() {
	echo '<a class="my-social-login" href="' . esc_url( home_url( '/social-login/' ) ) . '">' . esc_html__( 'Continue with Google', 'my-textdomain' ) . '</a>';
}
add_action( 'rpress_purchase_form_before_register_login', 'my_social_login_button', 10, 0 );

Notes#

Fired from the checkout purchase form and from the login and register shortcode templates.

Source#

Fired from:

  • includes/checkout/template.php (line 122), in rpress_show_purchase_form()
  • templates/shortcode-login.php (line 24)
  • templates/shortcode-register.php (line 26)

See also#

Was this page helpful?