Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to check if the author has permission to edit a post, if not then deny the save post.

But there do not seem a function which looks for a return statement.

I have seen an example here where they just exits the scripts, but I think there must be a better way, but I can not seem to find it.

share|improve this question
1  
WordPress does this by itself - can you post the code that you want to execute? You could also create a wp_redirect before the exit to send the user back. – fischi Dec 27 '12 at 10:08
My question is how can i deny saving a post, other than exiting the script myself? That do not seem right, that i have to exit the code myself, which could possible mess things up, because some things were not allowed to run properly. – Kevin Simper Dec 27 '12 at 10:58
Could you add an example of the code you're working with? If your using a custom function with the save_post action it is safe to return from it. In any case WordPress will not let users edit posts they don't have permissions for. – Jono Warren Jan 3 at 20:41

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.