Cleaner Role Creation Code

I just committed a change to how we populate roles during upgrade. The old way made adding new capabilities to existing roles a pain. The new way handles this nicely and is much easier on the eyes. Furthermore, it actually makes use of our role/cap API instead of going under the covers. What a concept, using our own API. 🙂

Give the changeset a look to make sure I didn’t leave out or mangle any caps.

6 thoughts on “Cleaner Role Creation Code

  1. Hmm. This turns one query via the old update_options() into around 70 distinct queries during the install. But apart from that, cool!

  2. I came across a few problems – people were experiencing problems registering because add_cap() requires 2 parameters and upgrade-schema.php calls only have one. Same goes for add_role() except that requires 3..
    I had an eventful morning today!

Leave a Reply to JoshuaCancel reply