Code Duplication    Length = 15-15 lines in 2 locations

src/wp-includes/class-wp-customize-nav-menus.php 1 location

@@ 1106-1120 (lines=15) @@
1103
	 */
1104
	public function customize_dynamic_partial_args( $partial_args, $partial_id ) {
1105
1106
		if ( preg_match( '/^nav_menu_instance\[[0-9a-f]{32}\]$/', $partial_id ) ) {
1107
			if ( false === $partial_args ) {
1108
				$partial_args = array();
1109
			}
1110
			$partial_args = array_merge(
1111
				$partial_args,
1112
				array(
1113
					'type'                => 'nav_menu_instance',
1114
					'render_callback'     => array( $this, 'render_nav_menu_partial' ),
1115
					'container_inclusive' => true,
1116
					'settings'            => array(), // Empty because the nav menu instance may relate to a menu or a location.
1117
					'capability'          => 'edit_theme_options',
1118
				)
1119
			);
1120
		}
1121
1122
		return $partial_args;
1123
	}

src/wp-includes/class-wp-customize-widgets.php 1 location

@@ 1599-1613 (lines=15) @@
1596
			return $partial_args;
1597
		}
1598
1599
		if ( preg_match( '/^widget\[(?P<widget_id>.+)\]$/', $partial_id, $matches ) ) {
1600
			if ( false === $partial_args ) {
1601
				$partial_args = array();
1602
			}
1603
			$partial_args = array_merge(
1604
				$partial_args,
1605
				array(
1606
					'type'                => 'widget',
1607
					'render_callback'     => array( $this, 'render_widget_partial' ),
1608
					'container_inclusive' => true,
1609
					'settings'            => array( $this->get_setting_id( $matches['widget_id'] ) ),
1610
					'capability'          => 'edit_theme_options',
1611
				)
1612
			);
1613
		}
1614
1615
		return $partial_args;
1616
	}