Not sure if this is the correct way to handle this, but...
Most of the built-in WordPress widgets handle the case of a blank title by not rendering a title block in the widget at all. We ran into this with a client recently - they were using the widget for an advertisement block and wanted to minimze the "fluff" around the icon.
I made a small patch to html-javascript-adder.php to check for a title string, and not include any title block if it's null. This is listed below (or, in case the forum mangles the patch, at http://pastebin.com/JPCgN3Mv )
- Code: Select all
--- html-javascript-adder.php.orig 2011-07-27 09:17:13.000000000 +1000
+++ html-javascript-adder.php 2011-07-27 09:56:40.000000000 +1000
@@ -118,7 +118,11 @@
## Display the Widget
function widget($args, $instance){
extract($args);
- $hja_title = apply_filters('widget_title', empty($instance['hja_title']) ? '' : $instance['hja_title'], $instance, $this->id_base);
+ $hja_title_block = "";
+ if ( $title ) {
+ $hja_title = apply_filters('widget_title', empty($instance['hja_title']) ? '' : $instance['hja_title'], $instance, $this->id_base);
+ $hja_title_block = $before_title . $hja_title . $after_title;
+ }
if(empty($instance['hja_content'])){
$hja_content = '';
@@ -134,9 +138,7 @@
## Output
$hja_output_content =
$before_widget . "\n\n<!-- Start - HTML Javascript Adder plugin v" . HJA_VERSION . " -->\n" .
- $before_title .
- $hja_title .
- $after_title .
+ $hja_title_block .
$hja_before_content .
$hja_content .
$this->hja_link_back() .
Thanks,
The1stImmortal