Code Duplication    Length = 22-24 lines in 2 locations

includes/process/save.php 2 locations

@@ 22-45 (lines=24) @@
19
	 *
20
	 * @return bool Always returns true.
21
	 */
22
	public function content( $data ) {
23
24
		$save_to_post_disabled = $this->save_to_post_disables();
25
26
		$postid = (int) $data[ 'post_id' ];
27
		$content = $this->replace_rendered_shortcodes( $data[ 'content' ] );
28
29
		if ( 'off' == $save_to_post_disabled || empty( $save_to_post_disabled ) ) {
30
31
			$args = array(
32
				'ID'           => (int) $postid,
33
				'post_content' => $content
34
			);
35
36
			wp_update_post( apply_filters( 'lasso_object_save_args', $args ) );
37
38
		}
39
40
		// run save action
41
		do_action( 'lasso_post_saved', $postid, $content, get_current_user_ID() );
42
43
		return true;
44
45
	}
46
47
	/**
48
	 * Process the post save
@@ 56-77 (lines=22) @@
53
	 *
54
	 * @return bool Always returns true.
55
	 */
56
	public function publish_content( $data ) {
57
		$save_to_post_disabled = $this->save_to_post_disables();
58
59
		$postid = (int) $data[ 'post_id' ];
60
		$content = $this->replace_rendered_shortcodes( $data[ 'content' ] );
61
62
		if ( 'off' == $save_to_post_disabled || empty( $save_to_post_disabled ) ) {
63
64
			$args = array (
65
				'ID'           	=> $postid,
66
				'post_content' 	=> $content,
67
				'post_status' 	=> 'publish'
68
			);
69
			wp_update_post( apply_filters( 'lasso_object_publish_args', $args ) );
70
71
		}
72
73
		do_action( 'lasso_post_published', $postid, $content, get_current_user_ID() );
74
75
		return true;
76
77
	}
78
79
	/**
80
	 * The keys required for the actions of this class.