MainWP Community

Change My Account Page Title for Non-logged In Users in WooCommerce

Change My Account page title for non-logged In users if using WooCommerce on your child site.

Snippet Type

Execute on Child Sites

Snippet

add_filter( 'the_title', 'display_product_image_in_order_item' );
function display_product_image_in_order_item( $title ) {
    if( is_account_page() && $title === __('My Account', 'woocommerce') && ! is_user_logged_in() ) {
        $title = __( 'Account Login / Register', 'woocommerce' );
    }
    return $title;
}
1 Like