[wp-trac] [WordPress Trac] #41101: Add filter to prevent the addition of a user to a blog
WordPress Trac
noreply at wordpress.org
Thu Aug 3 21:40:04 UTC 2017
#41101: Add filter to prevent the addition of a user to a blog
---------------------------------------------+------------------------
Reporter: jmdodd | Owner: flixos90
Type: enhancement | Status: closed
Priority: normal | Milestone: 4.9
Component: Users | Version: trunk
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests commit | Focuses: multisite
---------------------------------------------+------------------------
Changes (by flixos90):
* status: reviewing => closed
* resolution: => fixed
Comment:
In [changeset:"41225"]:
{{{
#!CommitTicketReference repository="" revision="41225"
Multisite: Introduce a `can_add_user_to_blog` filter to prevent adding a
user to a site.
Under certain circumstances, it can be necessary that a user should not be
added to a site, beyond the restrictions that WordPress core applies. With
the new `can_add_user_to_blog` filter, plugin developers can run custom
checks and return an error in case of a failure, that will prevent the
user from being added.
The user-facing parts and the REST API route that interact with
`add_user_to_blog()` have been adjusted accordingly to provide appropriate
error feedback when a user could not be added to a site. Furthermore, two
existing error feedback messages in the site admin's "New User" screen
have been adjusted to properly show inside an error notice instead of a
success notice.
Props jmdodd.
Fixes #41101.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41101#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list