Я хочу добавить к этому действию SQL-запрос
Код: Выделить всё
do_action( 'user_registration_after_register_user_action', self::$valid_form_data, $form_id, $user_id );
Мои попытки выдали ошибки. Как я могу решить эту проблему?
Код: Выделить всё
add_action( 'user_registration_after_register_user_action','set_invitee_to_accepted' , 100, 1 );
function set_invitee_to_accepted($valid_form_data) {
$data = $valid_form_data['user_email'];
$sql = 'SELECT email FROM invitee_table WHERE user_email = {$data}';
// run query
}
Код: Выделить всё
add_action( 'user_registration_after_register_user_action', array( $this, 'set_invitee_to_accepted' ), 5, 1 );
Подробнее здесь: https://stackoverflow.com/questions/791 ... -wordpress
Мобильная версия