Can’t activate plugin after adding WordPress roles in functions.php

Viewing 1 post (of 1 total)
#129563

Damiane Muller
Participant

Hi guys,

I have added some roles in the functions.php file using this code

add_role('student', 'Student', '');

This created a fatal error on the site. I found this error in the error log:

[01-Jun-2020 05:48:54 UTC] PHP Fatal error:  Uncaught Error: Cannot unset string offsets in /home/site/dev.siteurl.org.au/wp-includes/class-wp-role.php:75
Stack trace:
#0 /home/site/dev.siteurl.org.au/wp-content/plugins/download-manager/libs/class.Apply.php(665): WP_Role->remove_cap('access_server_b...')
#1 /home/site/dev.siteurl.org.au/wp-includes/class-wp-hook.php(287): WPDM\libs\Apply->sfbAccess('')
#2 /home/site/dev.siteurl.org.au/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
#3 /home/site/dev.siteurl.org.au/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
#4 /home/site/dev.siteurl.org.au/wp-settings.php(540): do_action('init')
#5 /home/site/dev.siteurl.org.au/wp-config.php(92): require_once('/home/site/...')
#6 /home/site/dev.siteurl.org.au/wp-load.php(37): require_once('/home/site/...')
#7 /home/site/dev.siteurl.org.au/wp-blog-header.php(13): require_once('/home/site/...' in /home/site/dev.siteurl.org.au/wp-includes/class-wp-role.php on line 75

The fatal error goes away when I disable the Download Manager plugin. Any help would be appreciated.

Viewing 1 post (of 1 total)

The topic ‘Can’t activate plugin after adding WordPress roles in functions.php’ is closed to new replies.