I can check whether a user has a given capability or not with
user_can() function, but how can I check what capability a certain action requires?
For example, I'm using
WP Job Manager plugin, this plugin introduce a new set of capabilities including
edit_job_listings. Now a certain user tries to submit the edit job listing form, but he does not have this specific capability.
Now how can I hook into this action (i.e. submiting editing job form) and see what capabilitie(s) this action require in order to be performed successfully. If I can get the answer to this question I can compare it with
user_can() result and can proceed accordingly with
wp_die() or something else.