WordPress/wp-includes/rest-api/endpoints
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
..
class-wp-rest-attachments-controller.php Docs: Remove @access notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-rest-comments-controller.php Docs: Remove @access notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-rest-controller.php Docs: Remove @access notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-rest-post-statuses-controller.php Docs: Remove @access notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-rest-post-types-controller.php Docs: Remove @access notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-rest-posts-controller.php General: Fix various instances of incorrect filter docs and incorrect filter and action parameters. 2017-08-03 15:43:43 +00:00
class-wp-rest-revisions-controller.php General: Fix various instances of incorrect filter docs and incorrect filter and action parameters. 2017-08-03 15:43:43 +00:00
class-wp-rest-settings-controller.php Docs: Remove @access notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-rest-taxonomies-controller.php Docs: Remove @access notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-rest-terms-controller.php Docs: Remove @access notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-rest-users-controller.php 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