Code Duplication    Length = 4-4 lines in 3 locations

json-endpoints/class.wpcom-json-api-update-post-endpoint.php 1 location

@@ 36-39 (lines=4) @@
33
		$args = $this->query_args();
34
35
		// unhook publicize, it's hooked again later -- without this, skipping services is impossible
36
		if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
37
			remove_action( 'save_post', array( $GLOBALS['publicize_ui']->publicize, 'async_publicize_post' ), 100, 2 );
38
			add_action( 'rest_api_inserted_post', array( $GLOBALS['publicize_ui']->publicize, 'async_publicize_post' ) );
39
		}
40
41
		if ( $new ) {
42
			$input = $this->input( true );

json-endpoints/class.wpcom-json-api-update-post-v1-1-endpoint.php 1 location

@@ 36-39 (lines=4) @@
33
		$args = $this->query_args();
34
35
		// unhook publicize, it's hooked again later -- without this, skipping services is impossible
36
		if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
37
			remove_action( 'save_post', array( $GLOBALS['publicize_ui']->publicize, 'async_publicize_post' ), 100, 2 );
38
			add_action( 'rest_api_inserted_post', array( $GLOBALS['publicize_ui']->publicize, 'async_publicize_post' ) );
39
		}
40
41
		// 'future' is an alias for 'publish' for now
42
		if ( 'future' === $input['status'] ) {

json-endpoints/class.wpcom-json-api-update-post-v1-2-endpoint.php 1 location

@@ 11-14 (lines=4) @@
8
		$args = $this->query_args();
9
10
		// unhook publicize, it's hooked again later -- without this, skipping services is impossible
11
		if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
12
			remove_action( 'save_post', array( $GLOBALS['publicize_ui']->publicize, 'async_publicize_post' ), 100, 2 );
13
			add_action( 'rest_api_inserted_post', array( $GLOBALS['publicize_ui']->publicize, 'async_publicize_post' ) );
14
		}
15
16
		// 'future' is an alias for 'publish' for now
17
		if ( isset( $input['status'] ) && 'future' === $input['status'] ) {