HEX
Server: nginx/1.22.0
System: Linux iZuf6jdxbygmf6cco977lcZ 5.10.84-10.4.al8.x86_64 #1 SMP Tue Apr 12 12:31:07 CST 2022 x86_64
User: root (0)
PHP: 7.4.29
Disabled: passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen
Upload Files
File: /data/wwwroot/wordpress/wp-content/plugins/change_admin_email/change_admin_email.php
<?php
/*
Plugin Name:修改站点邮箱地址
Plugin slug :change_admin_email
Plugin URI:https://www.themepark.com.cn/xcjxgwordpressdzdyglyd.html
Description:WordPress4.9之后需要接收到邮件才能修改站点邮箱地址,这个插件可以帮助你直接修改,WEB主题公园开发提供
Version: 1.0
Author: WEB主题公园
Author URI: http://www.themepark.com.cn
*/

add_action('admin_menu', 'change_admin_emai');
function change_admin_emai() {
	if(function_exists('add_menu_page')) {
		add_menu_page('change_admin_emai', '修改邮箱地址', 'administrator', 'change_admin_email_seting', 'change_admin_email_seting', plugins_url('themepark_comment.png', __FILE__ ));
		
		
	}
	
}
function change_admin_email_seting(){
if($_POST['Submit']) {
	$admin_email  = trim($_POST['admin_email']);
	 global $current_user;    wp_get_current_user();

	 wp_update_user( array ( 'ID' => $current_user->ID, 'user_email' =>  $admin_email,   ) ) ;
	update_option('admin_email', $admin_email);$text='修改成功!';
	
}
	 
?>
<div class="wrap">
	<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
	 <h3>修改你的站点邮箱和管理员邮箱</h3>
  <div id="message" class="updated fade"><p>请注意:这个选项会修改两个数据,一个数据是设置-常规中的“电子邮件地址”,另一个是当前登陆管理员的邮箱地址,如果你要修改,请确保当前管理员的地址需要和设置--常规中的电子邮箱地址一致。此插件由WEB主题公园开发提供<a target="_blank" href="http://www.themepark.com.cn">更多插件和主题,请访问WEB主题公园</a></p></div>
 
 
 
  <form method="post" action="<?php echo admin_url('admin.php?page=change_admin_email_seting'); ?>" style="width:70%;float:left;">

  <label>请填写新的管理员邮箱地址:<input type="text" size="60"  name="admin_email" id="admin_email" value=""/></label>
  <input type="submit" name="Submit" value="提交修改" class="button-primary"/>
  
  </form>	
	
</div>


<?php }?>