WC_Shortcode_My_Account::output()public staticWC 1.0

Output the shortcode.

Method of the class: WC_Shortcode_My_Account{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = WC_Shortcode_My_Account::output( $atts );
$atts(array) (required)
Shortcode attributes.

WC_Shortcode_My_Account::output() code WC 9.4.2

public static function output( $atts ) {
	global $wp;

	// Check cart class is loaded or abort.
	if ( is_null( WC()->cart ) ) {
		return;
	}

	self::my_account_add_notices();

	// Show the lost password page. This can still be accessed directly by logged in accounts which is important for the initial create password links sent via email.
	if ( isset( $wp->query_vars['lost-password'] ) ) {
		self::lost_password();
		return;
	}

	// Show login form if not logged in.
	if ( ! is_user_logged_in() ) {
		wc_get_template( 'myaccount/form-login.php' );
		return;
	}

	// Output the my account page.
	self::my_account( $atts );
}