Created
April 6, 2023 06:46
-
-
Save akther80/1c4c1c2e6c37c1667a70fcc60dd2aa3f to your computer and use it in GitHub Desktop.
Cartzilla - Add user profile in Handheld toolbar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'cartzilla_handheld_toolbar', 'cartzilla_wc_handheld_toolbar_user_profile', 60 ); | |
function cartzilla_wc_handheld_toolbar_user_profile() { | |
if ( cartzilla_navbar_is_account() ) : | |
?> | |
<a href="<?php echo get_permalink( wc_get_page_id( 'myaccount' ) ); ?>" class="d-table-cell cz-handheld-toolbar-item"> | |
<span class="cz-handheld-toolbar-icon"> | |
<?php echo get_avatar( wp_get_current_user(), 30, '', '', [ 'class' => 'rounded-circle' ] ); ?> | |
</span> | |
<span class="cz-handheld-toolbar-label"><?php echo esc_html_x( 'My Account', 'front-end', 'cartzilla' ); ?></span> | |
</a> | |
<?php endif; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment