[wp-trac] [WordPress Trac] #41101: Add filter to prevent the addition of a user to a blog

WordPress Trac noreply at wordpress.org
Tue Jul 25 12:43:07 UTC 2017


#41101: Add filter to prevent the addition of a user to a blog
-------------------------------------------------+-------------------------
 Reporter:  jmdodd                               |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Users                                |  Review
 Severity:  normal                               |     Version:  trunk
 Keywords:  has-patch has-unit-tests needs-      |  Resolution:
  testing                                        |     Focuses:  multisite
-------------------------------------------------+-------------------------

Comment (by jmdodd):

 Site-level user additions/edits can already be blocked using the existing
 action `user_profile_update_errors` in edit_user() (wp-
 admin/includes/user.php with code like this:

 {{{#!php
 <?php
 function dev_user_profile_update_errors( $errors, $update, $user ) {
         $errors->add( 'nope', 'Not happening.' );
 }
 add_action( 'user_profile_update_errors',
 'dev_user_profile_update_errors', 10, 3 );
 }}}

 I've added additional logic around multisite network additions to allow
 plugins to either display a custom error message, or to use a more generic
 default message.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41101#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list