On Wed, Sep 1, 2010 at 4:53 PM, Ken Newquist <span dir="ltr">&lt;<a href="mailto:newquisk@lafayette.edu">newquisk@lafayette.edu</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">The only specific role tweak that&#39;s one our wish list is to allow Authors to create drafts of pages (which could then be published by Editors). Right now only Editors can draft and publish pages (which isn&#39;t in keeping with the Contributor -&gt; Author progression, where contributors can create drafts of posts, but Authors can publish them; I&#39;d love to see that progression replicated with Author -&gt; Editor for pages).</div>

</blockquote><div><br></div><div>Changing the functionality of a core role is not something we can really do, even if that makes sense, for compatibility reasons.</div><div><br></div><div>It&#39;s actually a really simple plugin.  All you need to do is give Author the edit_pages capability. Two ways to do it -- alter the role in the database, or do a filter at runtime. No need to worry about plugin upgrades in that case, or compatibility with changes to core.</div>

<div><br></div><div>This untested example modifies the roles definition in the DB:</div><div><br></div><div>class Nacin_Authors_Draft_Pages {</div><div>   function Nacin_Authors_Draft_Pages() {</div><div>      register_activation_hook( __FILE__, array( &amp;$this, &#39;activate&#39; ) );</div>

<div>      register_deactivation_hook( __FILE__, array( &amp;$this, &#39;deactivate&#39; ) );</div><div>   }</div><div>   function activate() {</div><div>      $role = &amp;get_role( &#39;author&#39; );</div><div>      $role-&gt;add_cap( &#39;edit_pages&#39; );</div>

<div>   }</div><div>   function deactivate() {</div><div>      $role = &amp;get_role( &#39;author&#39; );</div><div>      $role-&gt;remove_cap( &#39;edit_pages&#39; );</div><div>   }</div><div>}</div><div>new Nacin_Authors_Draft_Pages;</div>

</div>