WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As above

Background info
Main problem: users pay to post an ad on the website Solution: they sign up as contributors and I publish their posts once the payment is received, after that they can make any edit to their posts

share|improve this question
up vote 3 down vote accepted

There is a capability in WordPress called "edit_published_posts". Contributors do not have this capability by default (refer to the Roles and Capabilities Codex page to see the out-of-box role configurations).

You can add this capability to the contributor role with code like this:

// get the "contributor" role object
$obj_existing_role = get_role( 'contributor' );

// add the "organize_gallery" capability
$obj_existing_role->add_cap( 'edit_published_posts' );

This code should only need to be run once--perhaps on activation of a plugin.

If you're not comfortable with code, you can use the Role Scoper plugin (or something like it) to add this capability to the contributor role.

share|improve this answer
Thanks! That works! – bfred.it Dec 15 '10 at 14:33
I don't have enough rep to comment, so I'm writing my question/clarification here. Where should I put this code? Thanks. :) – Drewdavid Nov 12 '12 at 21:26
@Drewdavid It's probably best in a plugin file, in a function hooked with register_activation_hook(). If that makes no sense to you, do this: put it in your theme's functions.php file. Then load the site once in your browser (to execute the code). Then remove the code from your functions file, and you're done. The code only needs to be run once. – MathSmath Dec 5 '12 at 16:27

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.