diff --git a/functions.php b/functions.php index dc390fd..8312209 100644 --- a/functions.php +++ b/functions.php @@ -151,6 +151,7 @@ add_action('template_include', function($template) { add_action('show_user_profile', 'kjweji_avatar_field'); add_action('edit_user_profile', 'kjweji_avatar_field'); function kjweji_avatar_field($user) { + wp_enqueue_media(); $att_id = get_user_meta($user->ID, 'custom_avatar', true); $preview = $att_id ? wp_get_attachment_image_url($att_id, 'medium') : ''; wp_nonce_field('kjweji_avatar_nonce', 'kjweji_avatar_nonce_field');