Code Duplication    Length = 12-14 lines in 2 locations

wp-includes/customize/class-wp-customize-nav-menu-item-setting.php 1 location

@@ 787-798 (lines=12) @@
784
				wp_slash( $menu_item_data )
785
			);
786
787
			if ( is_wp_error( $r ) ) {
788
				$this->update_status = 'error';
789
				$this->update_error = $r;
790
			} else {
791
				if ( $is_placeholder ) {
792
					$this->previous_post_id = $this->post_id;
793
					$this->post_id = $r;
794
					$this->update_status = 'inserted';
795
				} else {
796
					$this->update_status = 'updated';
797
				}
798
			}
799
		}
800
801
	}

wp-includes/customize/class-wp-customize-nav-menu-setting.php 1 location

@@ 530-543 (lines=14) @@
527
				$r = wp_update_nav_menu_object( $menu_id, wp_slash( $menu_data ) );
528
			}
529
530
			if ( is_wp_error( $r ) ) {
531
				$this->update_status = 'error';
532
				$this->update_error  = $r;
533
			} else {
534
				if ( $is_placeholder ) {
535
					$this->previous_term_id = $this->term_id;
536
					$this->term_id          = $r;
537
					$this->update_status    = 'inserted';
538
				} else {
539
					$this->update_status = 'updated';
540
				}
541
542
				$auto_add = $value['auto_add'];
543
			}
544
		}
545
546
		if ( null !== $auto_add ) {