From 641650117eb952191e0c191626ef95cf9d0aed9b Mon Sep 17 00:00:00 2001 From: azaozz Date: Fri, 27 Apr 2012 20:34:35 +0000 Subject: [PATCH] Widgets: remove the widget title shown in the widget header when empty or doesn't exist, part props kawauso, fixes #19925 git-svn-id: http://svn.automattic.com/wordpress/trunk@20628 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/js/widgets.dev.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/wp-admin/js/widgets.dev.js b/wp-admin/js/widgets.dev.js index 73b7eeb70b..8e3a05dd14 100644 --- a/wp-admin/js/widgets.dev.js +++ b/wp-admin/js/widgets.dev.js @@ -248,12 +248,14 @@ wpWidgets = { }, appendTitle : function(widget) { - var title = $('input[id*="-title"]', widget); - if ( title = title.val() ) { - title = title.replace(/<[^<>]+>/g, '').replace(//g, '>'); - $(widget).children('.widget-top').children('.widget-title').children() - .children('.in-widget-title').html(': ' + title); - } + var title = $('input[id*="-title"]', widget).val() || ''; + + if ( title ) + title = ': ' + title.replace(/<[^<>]+>/g, '').replace(//g, '>'); + + $(widget).children('.widget-top').children('.widget-title').children() + .children('.in-widget-title').html(title); + }, resize : function() {