Code Duplication    Length = 30-30 lines in 2 locations

wp-includes/meta.php 2 locations

@@ 216-245 (lines=30) @@
213
		$where['meta_value'] = $prev_value;
214
	}
215
216
	foreach ( $meta_ids as $meta_id ) {
217
		/**
218
		 * Fires immediately before updating metadata of a specific type.
219
		 *
220
		 * The dynamic portion of the hook, `$meta_type`, refers to the meta
221
		 * object type (comment, post, or user).
222
		 *
223
		 * @since 2.9.0
224
		 *
225
		 * @param int    $meta_id    ID of the metadata entry to update.
226
		 * @param int    $object_id  Object ID.
227
		 * @param string $meta_key   Meta key.
228
		 * @param mixed  $meta_value Meta value.
229
		 */
230
		do_action( "update_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
231
232
		if ( 'post' == $meta_type ) {
233
			/**
234
			 * Fires immediately before updating a post's metadata.
235
			 *
236
			 * @since 2.9.0
237
			 *
238
			 * @param int    $meta_id    ID of metadata entry to update.
239
			 * @param int    $object_id  Object ID.
240
			 * @param string $meta_key   Meta key.
241
			 * @param mixed  $meta_value Meta value.
242
			 */
243
			do_action( 'update_postmeta', $meta_id, $object_id, $meta_key, $meta_value );
244
		}
245
	}
246
247
	$result = $wpdb->update( $table, $data, $where );
248
	if ( ! $result )
@@ 253-282 (lines=30) @@
250
251
	wp_cache_delete($object_id, $meta_type . '_meta');
252
253
	foreach ( $meta_ids as $meta_id ) {
254
		/**
255
		 * Fires immediately after updating metadata of a specific type.
256
		 *
257
		 * The dynamic portion of the hook, `$meta_type`, refers to the meta
258
		 * object type (comment, post, or user).
259
		 *
260
		 * @since 2.9.0
261
		 *
262
		 * @param int    $meta_id    ID of updated metadata entry.
263
		 * @param int    $object_id  Object ID.
264
		 * @param string $meta_key   Meta key.
265
		 * @param mixed  $meta_value Meta value.
266
		 */
267
		do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
268
269
		if ( 'post' == $meta_type ) {
270
			/**
271
			 * Fires immediately after updating a post's metadata.
272
			 *
273
			 * @since 2.9.0
274
			 *
275
			 * @param int    $meta_id    ID of updated metadata entry.
276
			 * @param int    $object_id  Object ID.
277
			 * @param string $meta_key   Meta key.
278
			 * @param mixed  $meta_value Meta value.
279
			 */
280
			do_action( 'updated_postmeta', $meta_id, $object_id, $meta_key, $meta_value );
281
		}
282
	}
283
284
	return true;
285
}