Code Duplication    Length = 15-15 lines in 2 locations

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

@@ 850-864 (lines=15) @@
847
	 */
848
	public function customize_dynamic_partial_args( $partial_args, $partial_id ) {
849
850
		if ( preg_match( '/^nav_menu_instance\[[0-9a-f]{32}\]$/', $partial_id ) ) {
851
			if ( false === $partial_args ) {
852
				$partial_args = array();
853
			}
854
			$partial_args = array_merge(
855
				$partial_args,
856
				array(
857
					'type'                => 'nav_menu_instance',
858
					'render_callback'     => array( $this, 'render_nav_menu_partial' ),
859
					'container_inclusive' => true,
860
					'settings'            => array(), // Empty because the nav menu instance may relate to a menu or a location.
861
					'capability'          => 'edit_theme_options',
862
				)
863
			);
864
		}
865
866
		return $partial_args;
867
	}

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

@@ 1541-1555 (lines=15) @@
1538
			return $partial_args;
1539
		}
1540
1541
		if ( preg_match( '/^widget\[(?P<widget_id>.+)\]$/', $partial_id, $matches ) ) {
1542
			if ( false === $partial_args ) {
1543
				$partial_args = array();
1544
			}
1545
			$partial_args = array_merge(
1546
				$partial_args,
1547
				array(
1548
					'type'                => 'widget',
1549
					'render_callback'     => array( $this, 'render_widget_partial' ),
1550
					'container_inclusive' => true,
1551
					'settings'            => array( $this->get_setting_id( $matches['widget_id'] ) ),
1552
					'capability'          => 'edit_theme_options',
1553
				)
1554
			);
1555
		}
1556
1557
		return $partial_args;
1558
	}