src/Widget_Command.php
private function get_widget_data( $widget_id ) {

		$parts        = explode( '-', $widget_id );
		$option_index = array_pop( $parts );
		$name         = implode( '-', $parts );

		$sidebar_id    = false;
		$sidebar_index = false;
		$all_widgets   = $this->wp_get_sidebars_widgets();
		foreach ( $all_widgets as $s_id => &$widgets ) {

			$key = array_search( $widget_id, $widgets, true );
			if ( false !== $key ) {
				$sidebar_id    = $s_id;
				$sidebar_index = $key;
				break;
			}
		}

		return array( $name, $option_index, $sidebar_id, $sidebar_index );
	}
private function get_widget_data( $widget_id ) {

		$parts        = explode( '-', $widget_id );
		$option_index = array_pop( $parts );
		$name         = implode( '-', $parts );

		$sidebar_id    = false;
		$sidebar_index = false;
		$all_widgets   = $this->wp_get_sidebars_widgets();
		foreach ( $all_widgets as $s_id => &$widgets ) {

			$key = array_search( $widget_id, $widgets, true );
			if ( false !== $key ) {
				$sidebar_id    = $s_id;
				$sidebar_index = $key;
				break;
			}
		}

		return array( $name, $option_index, $sidebar_id, $sidebar_index );
	}
Gets the widget's name, option index, sidebar, and sidebar index from its ID

@param string $widget_id
@return array