protected function sanitize_contributors( $users ) {
		foreach ( $users as $i => $name ) {
			// Contributors should be listed by their WordPress.org Login name (Example: 'Joe Bloggs')
			$user = get_user_by( 'login', $name );

			// Or failing that, by their user_nicename field (Example: 'joe-bloggs')
			if ( ! $user ) {
				$user = get_user_by( 'slug', $name );
			}

			// In the event that something invalid is used, we'll ignore it (Example: 'Joe Bloggs (Australian Translation)')
			if ( ! $user ) {
				unset( $users[ $i ] );
				$this->warnings['contributor_ignored'] = true;
				continue;
			}

			// Overwrite whatever the author has specified with the sanitized nicename.
			$users[ $i ] = $user->user_nicename;
		}

		return $users;
	}
protected function sanitize_contributors( $users ) {
		foreach ( $users as $i => $name ) {
			// Contributors should be listed by their WordPress.org Login name (Example: 'Joe Bloggs')
			$user = get_user_by( 'login', $name );

			// Or failing that, by their user_nicename field (Example: 'joe-bloggs')
			if ( ! $user ) {
				$user = get_user_by( 'slug', $name );
			}

			// In the event that something invalid is used, we'll ignore it (Example: 'Joe Bloggs (Australian Translation)')
			if ( ! $user ) {
				unset( $users[ $i ] );
				$this->warnings['contributor_ignored'] = true;
				continue;
			}

			// Overwrite whatever the author has specified with the sanitized nicename.
			$users[ $i ] = $user->user_nicename;
		}

		return $users;
	}
protected function sanitize_contributors ( $ users ) { foreach ( $ users as $ i => $ name ) { // Contributors should be listed by their WordPress.org Login name (Example: 'Joe Bloggs') $ user = get_user_by ( 'login' , $ name ) ; // Or failing that, by their user_nicename field (Example: 'joe-bloggs') if ( ! $ user ) { $ user = get_user_by ( 'slug' , $ name ) ; } // In the event that something invalid is used, we'll ignore it (Example: 'Joe Bloggs (Australian Translation)') if ( ! $ user ) { unset ( $ users [ $ i ] ) ; $ this -> warnings [ 'contributor_ignored' ] = true ; continue ; } // Overwrite whatever the author has specified with the sanitized nicename. $ users [ $ i ] = $ user -> user_nicename ; } return $ users ; }
Sanitize provided contributors to valid WordPress users

@param array $users Array of user_login's or user_nicename's.
@return array Array of user_logins.
Sanitize provided contributors to valid WordPress users