Code Duplication    Length = 9-10 lines in 2 locations

modules/markdown/easy-markdown.php 2 locations

@@ 395-404 (lines=10) @@
392
	 * @param  int $id         post ID
393
	 * @return string          Swapped content
394
	 */
395
	public function edit_post_content( $content, $id ) {
396
		if ( $this->is_markdown( $id ) ) {
397
			$post = get_post( $id );
398
			if ( $post && ! empty( $post->post_content_filtered ) ) {
399
				$post = $this->swap_for_editing( $post );
400
				return $post->post_content;
401
			}
402
		}
403
		return $content;
404
	}
405
406
	/**
407
	 * Swap post_content_filtered and post_content for editing
@@ 412-420 (lines=9) @@
409
	 * @param  int $id         post ID
410
	 * @return string          Swapped content
411
	 */
412
	public function edit_post_content_filtered( $content, $id ) {
413
		// if markdown was disabled, let's turn this off
414
		if ( ! $this->is_posting_enabled() && $this->is_markdown( $id ) ) {
415
			$post = get_post( $id );
416
			if ( $post && ! empty( $post->post_content_filtered ) )
417
				$content = '';
418
		}
419
		return $content;
420
	}
421
422
	/**
423
	 * Some tags are allowed to have a 'markdown' attribute, allowing them to contain Markdown.