HEX
Server: nginx/1.16.1
System: Linux VM-0-14-centos 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64
User: www (1000)
PHP: 8.3.31
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/1.scey.cn/wp-content/themes/Leading/extends/wpjam-avatar/admin/avatar.php
<?php
function wpjam_edit_user_avatar_profile($profileuser){
	$avatarurl	= get_user_meta($profileuser->ID, 'avatarurl', true);

	echo '<h3>用户头像</h3>';

	wpjam_fields([
		'avatarurl'	=> ['title'=>'自定义头像', 'type'=>'img', 'item_type'=>'url', 'size'=>'200x200', 'value'=>$avatarurl]
	]); 
}
add_action('show_user_profile','wpjam_edit_user_avatar_profile',1);
add_action('edit_user_profile','wpjam_edit_user_avatar_profile',1);


function wpjam_edit_user_avatar_profile_update($user_id){

	if(current_user_can('edit_users') || get_current_user_id() == $user_id){

		$avatarurl	= $_POST['avatarurl'] ?: '';

		if($avatarurl){
			update_user_meta($user_id, 'avatarurl', $avatarurl);
		}else{
			delete_user_meta($user_id, 'avatarurl');
		}
	}
}
add_action('personal_options_update','wpjam_edit_user_avatar_profile_update');
add_action('edit_user_profile_update','wpjam_edit_user_avatar_profile_update');

add_action('admin_head', function(){
	?>
	<style type="text/css">
	.user-profile-picture{display: none;}
	</style>
	<?php
});