Code Duplication    Length = 5-5 lines in 2 locations

modules/likes.php 1 location

@@ 201-205 (lines=5) @@
198
		// Record sharing disable. Only needs to be done for WPCOM
199
		if ( ! $this->in_jetpack ) {
200
			if ( isset( $_POST['post_type'] ) && in_array( $_POST['post_type'], get_post_types( array( 'public' => true ) ) ) ) {
201
				if ( ! isset( $_POST['wpl_enable_post_sharing'] ) ) {
202
					update_post_meta( $post_id, 'sharing_disabled', 1 );
203
				} else {
204
					delete_post_meta( $post_id, 'sharing_disabled' );
205
				}
206
			}
207
		}
208

modules/sharedaddy/sharedaddy.php 1 location

@@ 184-188 (lines=5) @@
181
	if ( isset( $_POST['post_type'] ) && ( $post_type_object = get_post_type_object( $_POST['post_type'] ) ) && $post_type_object->public ) {
182
		if ( current_user_can( 'edit_post', $post_id ) ) {
183
			if ( isset( $_POST['sharing_status_hidden'] ) ) {
184
				if ( !isset( $_POST['enable_post_sharing'] ) ) {
185
					update_post_meta( $post_id, 'sharing_disabled', 1 );
186
				} else {
187
					delete_post_meta( $post_id, 'sharing_disabled' );
188
				}
189
			}
190
		}
191
	}