Code Duplication    Length = 17-19 lines in 3 locations

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

@@ 3629-3647 (lines=19) @@
3626
	 * }
3627
	 * @return array|IXR_Error
3628
	 */
3629
	public function wp_getCommentStatusList( $args ) {
3630
		$this->escape( $args );
3631
3632
		$username = $args[1];
3633
		$password = $args[2];
3634
3635
		if ( ! $user = $this->login( $username, $password ) ) {
3636
			return $this->error;
3637
		}
3638
3639
		if ( ! current_user_can( 'publish_posts' ) ) {
3640
			return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) );
3641
		}
3642
3643
		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
3644
		do_action( 'xmlrpc_call', 'wp.getCommentStatusList' );
3645
3646
		return get_comment_statuses();
3647
	}
3648
3649
	/**
3650
	 * Retrieve comment count.
@@ 3711-3727 (lines=17) @@
3708
	 * }
3709
	 * @return array|IXR_Error
3710
	 */
3711
	public function wp_getPostStatusList( $args ) {
3712
		$this->escape( $args );
3713
3714
		$username = $args[1];
3715
		$password = $args[2];
3716
3717
		if ( !$user = $this->login($username, $password) )
3718
			return $this->error;
3719
3720
		if ( !current_user_can( 'edit_posts' ) )
3721
			return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) );
3722
3723
		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
3724
		do_action( 'xmlrpc_call', 'wp.getPostStatusList' );
3725
3726
		return get_post_statuses();
3727
	}
3728
3729
	/**
3730
	 * Retrieve page statuses.
@@ 3743-3759 (lines=17) @@
3740
	 * }
3741
	 * @return array|IXR_Error
3742
	 */
3743
	public function wp_getPageStatusList( $args ) {
3744
		$this->escape( $args );
3745
3746
		$username = $args[1];
3747
		$password = $args[2];
3748
3749
		if ( !$user = $this->login($username, $password) )
3750
			return $this->error;
3751
3752
		if ( !current_user_can( 'edit_pages' ) )
3753
			return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) );
3754
3755
		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
3756
		do_action( 'xmlrpc_call', 'wp.getPageStatusList' );
3757
3758
		return get_page_statuses();
3759
	}
3760
3761
	/**
3762
	 * Retrieve page templates.