fjarrett / expire-passwords

Require certain users to change their passwords on a regular basis.

Home Page:https://wordpress.org/plugins/expire-passwords/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fatal error for undefined function get_editable_roles()

fjarrett opened this issue · comments

Today a user reported in the support forum that they were receiving a fatal error:

Fatal error: Call to undefined function get_editable_roles() in /wp-content/plugins/expire-passwords/expire-passwords.php on line 169

I can't reproduce it locally. But this has been discussed in other plugin support threads before too. It could be another plugin causing issues, or perhaps even a bug in WordPress core.

Nevertheless, the most straightforward fix will be to load in the file directly that defines get_editable_roles() if the function doesn't exist before calling it.

if ( ! function_exists( 'get_editable_roles' ) ) {
    require_once ABSPATH . 'wp-admin/includes/user.php';
}