Code Duplication    Length = 11-11 lines in 2 locations

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

@@ 235-245 (lines=11) @@
232
					$response[$key] = (string) $post->post_content;
233
				}
234
				break;
235
			case 'excerpt' :
236
				if ( 'display' === $context ) {
237
					add_filter( 'the_password_form', array( $this, 'the_password_form' ) );
238
					ob_start();
239
					the_excerpt();
240
					$response[$key] = (string) ob_get_clean();
241
					remove_filter( 'the_password_form', array( $this, 'the_password_form' ) );
242
				} else {
243
					$response[$key] = htmlspecialchars_decode( (string) $post->post_excerpt, ENT_QUOTES );
244
				}
245
				break;
246
			case 'status' :
247
				$response[$key] = (string) get_post_status( $post->ID );
248
				break;

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

@@ 218-228 (lines=11) @@
215
					$response[$key] = (string) $post->post_content;
216
				}
217
				break;
218
			case 'excerpt' :
219
				if ( 'display' === $context ) {
220
					add_filter( 'the_password_form', array( $this, 'the_password_form' ) );
221
					ob_start();
222
					the_excerpt();
223
					$response[$key] = (string) ob_get_clean();
224
					remove_filter( 'the_password_form', array( $this, 'the_password_form' ) );
225
				} else {
226
					$response[$key] = htmlspecialchars_decode( (string) $post->post_excerpt, ENT_QUOTES );
227
				}
228
				break;
229
			case 'status' :
230
				$response[$key] = (string) get_post_status( $post->ID );
231
				break;