我正在尝试为所有未填充user_url字段的用户设置默认值。我还将尝试在用户注册时执行此操作,但似乎无法使它继续进行。我已经剥离了代码以删除条件语句(如果它们现在具有一个填充字段),因为我只是想让它更新用户网址!
任何帮助表示赞赏。
function add_info_to_post() {
update_user_meta( $user_id,'user_url','http://#' );
}
add_action( 'profile_update','add_info_to_post' );
add_action( 'personal_options_update','add_info_to_post' );
add_action( 'edit_user_profile_update','add_info_to_post' );