Created
March 15, 2023 07:34
-
-
Save Alimir/0abd0f932123dd779fcd84115a57a8ff to your computer and use it in GitHub Desktop.
Add upload avatar field on account form
This file contains 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
<?php | |
/** | |
* Add upload avatar field on account form | |
* | |
* @param string $type | |
* @param array $args | |
* @return void | |
*/ | |
function wp_ulike_pro_custom_account_form( $type, $args ){ | |
if( $type == 'profile' ): | |
?> | |
<div class="ulp-flex-col-xl-12 ulp-flex-col-md-12 ulp-flex-col-xs-12"> | |
<div class="wp-ulike-pro-profile-user-avatar" style="display: flex; justify-content: center; margin: 0 0 20px;"> | |
<?php if( WP_Ulike_Pro_Options::isLocalAvatars() ) : ?> | |
<?php echo WP_Ulike_Pro_Avatar::get_avatar_uploader( $args->user->ID, [ 'size' => 300 ] );?> | |
<?php else : ?> | |
<?php echo WP_Ulike_Pro_Avatar::get_avatar( $args->user->user_email, 300 );?> | |
<?php endif; ?> | |
</div> | |
</div> | |
<?php | |
endif; | |
} | |
add_action( 'wp_ulike_pro_forms_before_hook', 'wp_ulike_pro_custom_account_form', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment