Code Duplication    Length = 5-5 lines in 2 locations

modules/likes.php 1 location

@@ 218-222 (lines=5) @@
215
		// Record sharing disable. Only needs to be done for WPCOM
216
		if ( ! $this->in_jetpack ) {
217
			if ( isset( $_POST['post_type'] ) && in_array( $_POST['post_type'], get_post_types( array( 'public' => true ) ) ) ) {
218
				if ( ! isset( $_POST['wpl_enable_post_sharing'] ) ) {
219
					update_post_meta( $post_id, 'sharing_disabled', 1 );
220
				} else {
221
					delete_post_meta( $post_id, 'sharing_disabled' );
222
				}
223
			}
224
		}
225

modules/sharedaddy/sharedaddy.php 1 location

@@ 157-161 (lines=5) @@
154
	if ( isset( $_POST['post_type'] ) && ( $post_type_object = get_post_type_object( $_POST['post_type'] ) ) && $post_type_object->public ) {
155
		if ( current_user_can( 'edit_post', $post_id ) ) {
156
			if ( isset( $_POST['sharing_status_hidden'] ) ) {
157
				if ( !isset( $_POST['enable_post_sharing'] ) ) {
158
					update_post_meta( $post_id, 'sharing_disabled', 1 );
159
				} else {
160
					delete_post_meta( $post_id, 'sharing_disabled' );
161
				}
162
			}
163
		}
164
	}