Code Duplication    Length = 5-5 lines in 2 locations

modules/sharedaddy/sharedaddy.php 1 location

@@ 195-199 (lines=5) @@
192
	if ( isset( $_POST['post_type'] ) && ( $post_type_object = get_post_type_object( $_POST['post_type'] ) ) && $post_type_object->public ) {
193
		if ( current_user_can( 'edit_post', $post_id ) ) {
194
			if ( isset( $_POST['sharing_status_hidden'] ) ) {
195
				if ( !isset( $_POST['enable_post_sharing'] ) ) {
196
					update_post_meta( $post_id, 'sharing_disabled', 1 );
197
				} else {
198
					delete_post_meta( $post_id, 'sharing_disabled' );
199
				}
200
			}
201
		}
202
	}

modules/likes/jetpack-likes-settings.php 1 location

@@ 124-128 (lines=5) @@
121
		// Record sharing disable. Only needs to be done for WPCOM
122
		if ( ! $this->in_jetpack ) {
123
			if ( isset( $_POST['post_type'] ) && in_array( $_POST['post_type'], get_post_types( array( 'public' => true ) ) ) ) {
124
				if ( ! isset( $_POST['wpl_enable_post_sharing'] ) ) {
125
					update_post_meta( $post_id, 'sharing_disabled', 1 );
126
				} else {
127
					delete_post_meta( $post_id, 'sharing_disabled' );
128
				}
129
			}
130
		}
131