woocommerce_account_content()
My Account content output.
Hooks from the function
Returns
null. Nothing (null).
Usage
woocommerce_account_content();
woocommerce_account_content() woocommerce account content code WC 10.7.0
function woocommerce_account_content() {
global $wp;
if ( ! empty( $wp->query_vars ) ) {
foreach ( $wp->query_vars as $key => $value ) {
// Ignore pagename param.
if ( 'pagename' === $key ) {
continue;
}
if ( has_action( 'woocommerce_account_' . $key . '_endpoint' ) ) {
do_action( 'woocommerce_account_' . $key . '_endpoint', $value );
return;
}
}
}
// No endpoint found? Default to dashboard.
wc_get_template(
'myaccount/dashboard.php',
array(
'current_user' => get_user_by( 'id', get_current_user_id() ),
)
);
}