Code Duplication    Length = 6-13 lines in 3 locations

wp-includes/class-wp-xmlrpc-server.php 3 locations

@@ 2406-2418 (lines=13) @@
2403
		$password = $args[2];
2404
		$user_id  = (int) $args[3];
2405
2406
		if ( isset( $args[4] ) ) {
2407
			$fields = $args[4];
2408
		} else {
2409
			/**
2410
			 * Filters the default user query fields used by the given XML-RPC method.
2411
			 *
2412
			 * @since 3.5.0
2413
			 *
2414
			 * @param array  $fields User query fields for given method. Default 'all'.
2415
			 * @param string $method The method name.
2416
			 */
2417
			$fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getUser' );
2418
		}
2419
2420
		if ( ! $user = $this->login( $username, $password ) )
2421
			return $this->error;
@@ 2471-2476 (lines=6) @@
2468
		$password = $args[2];
2469
		$filter   = isset( $args[3] ) ? $args[3] : array();
2470
2471
		if ( isset( $args[4] ) ) {
2472
			$fields = $args[4];
2473
		} else {
2474
			/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2475
			$fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getUsers' );
2476
		}
2477
2478
		if ( ! $user = $this->login( $username, $password ) )
2479
			return $this->error;
@@ 2544-2549 (lines=6) @@
2541
		$username = $args[1];
2542
		$password = $args[2];
2543
2544
		if ( isset( $args[3] ) ) {
2545
			$fields = $args[3];
2546
		} else {
2547
			/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2548
			$fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getProfile' );
2549
		}
2550
2551
		if ( ! $user = $this->login( $username, $password ) )
2552
			return $this->error;