Login_Register implements Registerable, Standard_Service
Shortcode and handlers for the wholesale Login / Register form
Tags
Interfaces, Classes and Traits
- Registerable
- Standard_Service
Table of Contents
- $login_shortcode_tag : mixed
- $register_shortcode_tag : mixed
- $template_directory : mixed
- $template_html : mixed
- __construct() : mixed
- Constructor.
- allowed_redirect_hosts() : array<string|int, mixed>
- Add the host of the custom redirect URL to the allowed redirect hosts
- body_class() : array<string|int, mixed>
- Add body class to login page.
- do_shortcode_login() : mixed
- Render login shortcode
- do_shortcode_register() : mixed
- Render register shortcode
- handle_redirects() : mixed
- Handle redirects based on wholesale status.
- inject_registration_success_notices() : string
- Add success notices to custom registration redirect.
- prevent_caching() : mixed
- Prevent caching on our login page
- process_login() : mixed
- Process the login form.
- process_registration() : mixed
- Process the registration form.
- register() : mixed
- {@inheritdoc}
- wp_login_redirect() : string
- Redirect standard WP logins for wholesale users
- maybe_handle_registration_redirect() : mixed
- Redirect standard WP logouts for wholesale users
Properties
$login_shortcode_tag
private
mixed
$login_shortcode_tag
Tags
$register_shortcode_tag
private
mixed
$register_shortcode_tag
Tags
$template_directory
private
mixed
$template_directory
Tags
$template_html
private
mixed
$template_html
Tags
Methods
__construct()
Constructor.
public
__construct(string $template_directory) : mixed
Parameters
- $template_directory : string
Tags
Return values
mixed —allowed_redirect_hosts()
Add the host of the custom redirect URL to the allowed redirect hosts
public
allowed_redirect_hosts(array<string|int, mixed> $allowed_hosts) : array<string|int, mixed>
Parameters
- $allowed_hosts : array<string|int, mixed>
-
The array of hosts allowed to redirect to
Tags
Return values
array<string|int, mixed> —The resulting array
body_class()
Add body class to login page.
public
body_class(array<string|int, mixed> $classes) : array<string|int, mixed>
Add woocommerce-page
to body class
Parameters
- $classes : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —do_shortcode_login()
Render login shortcode
public
do_shortcode_login() : mixed
Tags
Return values
mixed —do_shortcode_register()
Render register shortcode
public
do_shortcode_register() : mixed
Tags
Return values
mixed —handle_redirects()
Handle redirects based on wholesale status.
public
handle_redirects() : mixed
Tags
Return values
mixed —inject_registration_success_notices()
Add success notices to custom registration redirect.
public
inject_registration_success_notices(string $content) : string
Parameters
- $content : string
Tags
Return values
string —prevent_caching()
Prevent caching on our login page
public
prevent_caching() : mixed
Tags
Return values
mixed —process_login()
Process the login form.
public
static process_login() : mixed
Tags
Return values
mixed —process_registration()
Process the registration form.
public
static process_registration() : mixed
Tags
Return values
mixed —register()
{@inheritdoc}
public
register() : mixed
Tags
Return values
mixed —wp_login_redirect()
Redirect standard WP logins for wholesale users
public
wp_login_redirect(string $redirect_to, string $requested_redirect_to, WP_User|WP_Error $user) : string
Parameters
- $redirect_to : string
-
The redirect destination URL.
- $requested_redirect_to : string
-
The requested redirect destination URL passed as a parameter.
- $user : WP_User|WP_Error
-
WP_User object if login was successful, WP_Error object otherwise.
Tags
Return values
string —maybe_handle_registration_redirect()
Redirect standard WP logouts for wholesale users
private
static maybe_handle_registration_redirect(bool $moderation) : mixed
Parameters
- $moderation : bool
-
Used to determine the correct success notice after redirect.