NextGEN User Roles

Recently I needed to migrate www.blueribbonraceway.com.au from one host to another. The site also uses www.blueribbonraceway.com. Before the migration the .com domain was the primary domain and the .com.au was the redirect.  Initially I thought we could keep the site working if we used .com as the primary domain name and the .com.au would become redirect.

Unfortunately nothing went to plan and the site was down for a few days while the accounting was fixed up.
What had happened was there were lots of references to the website using both .com and .com.au – the migration didn’t work to well and I had to spend a lot of time hand editing the SQL database to make every reference just blueribbonraceway.com.au

One of my favourite plugins used by this site was All-In-One-Events-Calendar plugin, but regardless what I tried to get it to work on the new host, it wouldn’t play. The last straw was fiddling with the roles manager in WordPress. AI1E Calendar still wouldn’t work and in my hast I also broke NextGEN.

NextGen is an amazing photo gallery plugin that allows you to easily manage photos in WordPress.  The latest version of WordPress has implemented fundamental functions like albums, but it still isn’t quite as good as NextGen.

To repair the NextGen user roles I found the following fix at role-editor.com

A file called must-use.php needs to be created in wp-content/mu-plugins/ folder.

function restore_lost_capabilities() {

global $wp_roles;

$caps_to_restore = [
‘NextGEN Gallery overview’,
‘NextGEN Use TinyMCE’,
‘NextGEN Upload images’,
‘NextGEN Manage gallery’,
‘NextGEN Manage others gallery’,
‘NextGEN Manage tags’,
‘NextGEN Edit album’,
‘NextGEN Change style’,
‘NextGEN Change options’,
‘NextGEN Attach Interface’
];

$role = $wp_roles->get_role(‘administrator’);
foreach($caps_to_restore as $cap) {
if (!$role->has_cap($cap)) {
$role->add_cap($cap, true);
}
}

}

add_action(‘admin_init’, ‘restore_lost_capabilities’);

After this is created, log into your website and then select User Roles.  Ensure that the setting are correct and then delete the must-use.php file.

Blueribbonraceway.com.au is almost back to normal again.  I have just given up on AI1E Calendar and I am now looking for a replacement calendar.