Widgets: remove the widget title shown in the widget header when empty or doesn't exist, part props kawauso, fixes #19925

git-svn-id: https://develop.svn.wordpress.org/trunk@20628 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2012-04-27 20:34:35 +00:00
parent 001e92a1f2
commit 29e2ec2ac5
1 changed files with 8 additions and 6 deletions

View File

@ -248,12 +248,14 @@ wpWidgets = {
}, },
appendTitle : function(widget) { appendTitle : function(widget) {
var title = $('input[id*="-title"]', widget); var title = $('input[id*="-title"]', widget).val() || '';
if ( title = title.val() ) {
title = title.replace(/<[^<>]+>/g, '').replace(/</g, '&lt;').replace(/>/g, '&gt;'); if ( title )
$(widget).children('.widget-top').children('.widget-title').children() title = ': ' + title.replace(/<[^<>]+>/g, '').replace(/</g, '&lt;').replace(/>/g, '&gt;');
.children('.in-widget-title').html(': ' + title);
} $(widget).children('.widget-top').children('.widget-title').children()
.children('.in-widget-title').html(title);
}, },
resize : function() { resize : function() {