Skip to content

Instantly share code, notes, and snippets.

@Alimir
Created March 15, 2023 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Alimir/0abd0f932123dd779fcd84115a57a8ff to your computer and use it in GitHub Desktop.
Save Alimir/0abd0f932123dd779fcd84115a57a8ff to your computer and use it in GitHub Desktop.
Add upload avatar field on account form
<?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