From my understanding, you want to verify if the user who will visit the entries should be registered, right?
If so you might need to use the WP is_user_logged_in() function to verify if the user is logged which would be required to access the entries.
As an alternative, you can use WP Query to create a function that searches for the email, note that you will need to ask for it first and check if does exist before providing access to the entries if you don’t want to check if the user is logged.
Thank you for fast answer but obviously I didn’t explained well. Let me try again. Upon my user complete “Account request” over forminator form his entry comes to my Admin Dashboard so I need to click “Approve user” as on picture bellow.
By that action my “user” comes to list of regular WordPress users and he can use account to login etc….
Now I’m integrating API functionality so I can “Approve user” by other actions such as over discord chat.
My question is (if exist) which API endpoint I need to use so I can approve user through API request. I just want to approve user through code instead of manually clicking ?
Forminator doesn’t store information regarding this and it uses the default workflow of WordPress for registration and approval ie via the wp_signups table.
There isn’t any inbuilt API that I could find which could alter the data within the wp_signups table, however, I’m checking with our developer to see if there are any insights that could be suggested in such a use case.
Will keep you posted once we get further feedback.
I got further feedback and you can check the following example code as a reference and see whether it helps in moving forward:
$entry = new Forminator_Form_Entry_Model( $entry_id );
//$entry_id should be passed via API
$activation_key = $entry->get_meta( 'activation_key' );
if ( false !== $activation_key ) {
Forminator_CForm_User_Signups::activate_signup( $activation_key, true );
}
Since we haven’t heard from you for a while. I’ll mark this thread as resolved for now. Please feel free to re-open the thread if you need further assistance.
Kind Regards Nithin
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘Approve user – Forminator API’ is closed to new replies.