On action, change user role

Couple of things perhaps spring to mind – when using add_action you’ll need to provide how many of the arguments you’re planning on using. Default 1. You’re not using request info so get rid of that. Second bit geodir_get_current_posttype() link

Read through how the function works and make sure it makes sense and would work in the context you are using it. It looks like it reads a query var from the URL – is that there?

Another option could just be to look this up yourself – looks like you’ve got the $last_post_id variable. Can you not find out the info you need from that?

Plenty of var_dumps and die can help you diagnose what you’re missing. Looks like the plugin author leaves most of them in the code anyway!