Hey @Himanshu_Singh, the short answer is that the WP Discourse plugin does not store the approval status of the Discourse user.
I’d suggest you take a look at the wpdc_after_sync_sso action, which is fired after the user record is synced after a user logs into Wordpress.
If you stick a log in there, e.g.
function wpdc_after_sync_sso_callback($discourse_user, $user_id) {
error_log(print_r($discourse_user, true));
}
add_action( 'wpdc_after_sync_sso', 'wpdc_after_sync_sso_callback', 10, 2 );
You’ll see that the discourse_user object contains the approval status of the user, e.g.
stdClass Object
(
[id] => 43
[username] => angus4
[name] => angus4
...
[approved] =>
)
Which you could then store yourself in a user custom field and use to create your dynamic link.