WordPress/wp-includes/rest-api
Felix Arntz 7e2ca92e69 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.

Built from https://develop.svn.wordpress.org/trunk@41225


git-svn-id: http://core.svn.wordpress.org/trunk@41065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-03 21:41:45 +00:00
..
endpoints Multisite: Introduce a can_add_user_to_blog filter to prevent adding a user to a site. 2017-08-03 21:41:45 +00:00
fields Docs: Remove @access notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-rest-request.php Docs: Replace HTTP links to stackoverflow.com in DocBlocks with HTTPS. 2017-07-30 14:52:44 +00:00
class-wp-rest-response.php Docs: Remove @access notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-rest-server.php REST API: Exclude numeric parameters from regex parsing 2017-08-03 19:55:43 +00:00