我希望在用户成功填写并提交WordPress注册表以及用户更新其配置文件时“仅”运行PHP脚本。
这是我目前掌握的情况,
Registration
----------------
function soapConn() {
if (!isset($_POST[\'submit-btn\'])) {
} else {
// If pressed, run the script
// Should I check for validation here? Such as if the inputs are empty?
require_once locate_template(\'include/xxxx.php\', true);
}
}
add_action(\'registration_errors\', \'soapConn\');
Update user profile
-------------------
add_action( \'profile_update\', \'my_profile_update\', 10, 2 );
function my_profile_update( $user_id, $old_user_data ) {
require_once locate_template(\'include/xxxx.php\', true);
}
通过这种方式,可以避免我在PHP脚本文件中收听注册/概要文件更新提交按钮时遇到的麻烦。
是否有人可以帮助并确认这是解决此问题的正确方法?
感谢您抽出时间。