Code Duplication    Length = 13-14 lines in 2 locations

core/Container/User_Meta_Container.php 1 location

@@ 69-81 (lines=13) @@
66
	 *
67
	 * @param int $user_id ID of the user against which save() is ran
68
	 **/
69
	public function save( $user_id = null ) {
70
		// Unhook action to garantee single save
71
		remove_action( 'profile_update', array( $this, '_save' ) );
72
73
		$this->set_user_id( $user_id );
74
75
		foreach ( $this->fields as $field ) {
76
			$field->set_value_from_input( stripslashes_deep( $_POST ) );
77
			$field->save();
78
		}
79
80
		do_action( 'carbon_after_save_user_meta', $user_id );
81
	}
82
83
	/**
84
	 * Perform checks whether the container should be attached during the current request

core/Container/Post_Meta_Container.php 1 location

@@ 110-123 (lines=14) @@
107
	 *
108
	 * @param int $post_id ID of the post against which save() is ran
109
	 **/
110
	public function save( $post_id = null ) {
111
		// Unhook action to garantee single save
112
		remove_action( 'save_post', array( $this, '_save' ) );
113
114
		$this->set_post_id( $post_id );
115
116
		foreach ( $this->fields as $field ) {
117
			$field->set_value_from_input( stripslashes_deep( $_POST ) );
118
			$field->save();
119
		}
120
121
		do_action( 'carbon_after_save_custom_fields', $post_id );
122
		do_action( 'carbon_after_save_post_meta', $post_id );
123
	}
124
125
	/**
126
	 * Perform checks whether the container should be attached during the current request