Extended Super Admins 0.5a

Over the last few days, I’ve released a handful of new versions for this plugin. The current stable version is 0.5a, which finally fixes a frustrating bug identified by RavanH. Basically, in certain installations of WordPress, under specific circumstances, it was impossible to delete roles once you’d created them. Instead, each time you tried to delete a role, that role would persist and a new empty role would be created.

After trying with one or two versions to fix the issue (and making other adjustments and improvements along the way), I finally figured out that the bug was related to the fact that, while the register_setting() function works fine for sitewide options in WordPress 3.0.x, it does not do anything for sitewide options in WordPress 3.1. Therefore, the function that organized and sanitized the settings before saving them to the database wasn’t being fired in WordPress 3.1.

I don’t know if this is a bug in WordPress 3.1, or if this is intended behavior. After all, the register_setting() function was initially meant to register and sanitize options that are being stored in the ‘options’ table, not the ‘sitemeta’ table, and is generally used in conjunction with the add_settings_section(), add_settings_field() and do_settings_sections() functions (which all only apply to options for individual sites). Regardless, the Extended Super Admins plugin relied upon the register_setting() function to call the sanitization callback, which wasn’t happening in WordPress 3.1.

Some of the other changes that were implemented between 0.2a and 0.5a include some new style changes, some new JavaScript, making the plugin compatible with the Networks for WordPress plugin (which is the new version of the plugin on which WordPress Multi Network was based) and, most importantly, the plugin now retrieves information directly from the WordPress Codex about each of the capabilities listed on the settings page (where available).

To make a long story short (too late!), this plugin is now up to version 0.5a. Version 0.6a will most likely be released very soon (possibly tonight or tomorrow) and implements a major change in the user interface. More about that later.

Update: The register_setting() function does, in fact, work just fine in WordPress 3.1, but it has to be hooked from the admin_init action rather than the init action. I’m not sure why it appeared to be working in WordPress 3.0.x, as it shouldn’t have worked the way I was instantiating it there, either. This was my fault, and is definitely not a bug or inconsistency in either version of WordPress.

Leave a Reply

Your email address will not be published. Required fields are marked *