How can I set a Widget’s title in for use in the Dashboard?
-
Hello,
I am making a custom Links widget, and I would like to be able to set the title of the widget (when in the dashboard) to be the name of the Links Catgory that I’m displaying. The result should be the same as when you’re using a text widget, and you’ve set a title.
I’m a little bit confused about how to accomplish this.
Does the widget title automatically get set if there is a “title” field?
It looks like the appended title is being set in widgets.dev.js, near line 244:
appendTitle : function(widget) { var title = $('input[id*="-title"]', widget); if ( title = title.val() ) { title = title.replace(/<[^<>]+>/g, '').replace(/</g, '<').replace(/>/g, '>'); $(widget).children('.widget-top').children('.widget-title').children() .children('.in-widget-title').html(': ' + title); } }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How can I set a Widget’s title in for use in the Dashboard?’ is closed to new replies.