﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
6108	In admin, current widgets should show something more identifiable than the type of widget	mdawaffe	mdawaffe	"Currently, if you have multiple text widgets, you just see them listed as ""Text"", ""Text"", ... in the ""Current Widgets"" section.

It'd be nice if the widgets instead were listed as ""Text: foo"", ""Text: bar"", ... where 'foo' and 'bar' are taken from the widget's title or content or something (for all widgets, not just text widgets).

Attached are two patches.  Both output titles as ""{widget_type}: {extracted_text}"".  The first patch accomplishes this via JS, the second via PHP.

----

JS Patch:

Each widget in the ""Current Widgets"" section is scanned for visible text inputs and textareas.  If any are found, the first 22 text characters of the first input element found are used as the {extracted_text}.

Pros: Not much code change.[[BR]]
Cons: Not super robust.

----

PHP Patch:

The display of the ""Current Widgets"" section is switched to a hacked {{{dynamic_sidebar()}}} (similar in concept to the dashboard widgets code).  While displaying each widget control form, the on-blog widget itself is output_buffered and its title extracted for use as the {extracted_text}.

The use of the {{{dynamic_sidebar}}} and output buffering is necessary because WP has no way of determining the title that will be displayed on-blog of some random widget; widget's neither store nor output their content in any standard way.

Pros: More robust.  If a widget outputs a title on-blog, this code will catch it.[[BR]]
Cons: A lot of code change, much of which is a bit hacky."	defect (bug)	closed	normal	2.5	Administration	2.5	normal	fixed	widgets has-patch 2nd-opnion	
