Code Duplication    Length = 5-5 lines in 2 locations

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

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

modules/sharedaddy/sharedaddy.php 1 location

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