You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey maintainer friends! A user of one of my plugins identified a mild incompatibility with this one, and I'd like to provide some context and a recommended code change.
WP User Profiles completely replaces the "Edit" experience of editing a user. Think of it like Gutenberg for editing users!
To work, my plugin has to jump through some hoops like Gutenberg does. One of those hoops means that all of the variables inside of WordPress user-edit.php that are actually globals, are not really global anymore in my plugin.
I have made a special consideration for $user_id, but some variables like $title, $sessions, $user_roles, $blogs, $languages, and $errors I am reluctant to explicitly define as globals everywhere in my plugin when they are not needed in it as globals (though they are used inside of their respective methods).
Problem
The Classic Editor plugin uses the $user_can_edit global variable from user-edit.php to determine whether or not to show the per-user "Default Editor" profile option. Because this global is not defined in my plugin, this profile option never appears when using it.
Recommended Solution
I'm thinking that using the global in the Classic Editor plugin might not be a good idea for plugin compatibility reasons like this one. Any global variable can simply be overwritten by any plugin for any reason on this page, triggering this problem.
If the Classic Editor plugin did its own internal capability checks, this specific incompatibility (and maybe any other potential ones) could be avoided.
The text was updated successfully, but these errors were encountered:
Hey maintainer friends! A user of one of my plugins identified a mild incompatibility with this one, and I'd like to provide some context and a recommended code change.
Message
See: stuttter/wp-user-profiles#60 (comment)
Context
WP User Profiles completely replaces the "Edit" experience of editing a user. Think of it like Gutenberg for editing users!
To work, my plugin has to jump through some hoops like Gutenberg does. One of those hoops means that all of the variables inside of WordPress
user-edit.php
that are actually globals, are not really global anymore in my plugin.I have made a special consideration for
$user_id
, but some variables like$title
,$sessions
,$user_roles
,$blogs
,$languages
, and$errors
I am reluctant to explicitly define as globals everywhere in my plugin when they are not needed in it as globals (though they are used inside of their respective methods).Problem
The Classic Editor plugin uses the
$user_can_edit
global variable fromuser-edit.php
to determine whether or not to show the per-user "Default Editor" profile option. Because this global is not defined in my plugin, this profile option never appears when using it.Recommended Solution
I'm thinking that using the global in the Classic Editor plugin might not be a good idea for plugin compatibility reasons like this one. Any global variable can simply be overwritten by any plugin for any reason on this page, triggering this problem.
If the Classic Editor plugin did its own internal capability checks, this specific incompatibility (and maybe any other potential ones) could be avoided.
The text was updated successfully, but these errors were encountered: