Add a shortcode in a sidebar widget title

i have one question…
how can u add a shortcode in a sidebar widget title?
i know that for the widget is :


	add_filter( 'widget_text', 'shortcode_unautop');
	add_filter( 'widget_text', 'do_shortcode');

but for the title?

An obvious guess would be widget_title … ?

:)) i did that … it worked :)) stupid me… now another question… how do i register multiple functions, with a for?:slight_smile:

Register multiple functions…?

Can you please show some code? I don’t fully understand, what you want to do :slight_smile:

Register multiple functions..?

Can you please show some code? I don’t fully understand, what you want to do :slight_smile:

hey.


	function icon1() { return '';}
	add_shortcode('icon1','icon1');	
	function icon2() { return '';}
	add_shortcode('icon2','icon2');	
	function icon3() { return '';}
	add_shortcode('icon3','icon3');	
	function icon4() { return '';}
	add_shortcode('icon4','icon4');	

there are alot of icons and i want to do this with a for :smiley: thank you

Hey duotive the next time please write a useful title man not just ‘Hey’, that way your problem can solve others problems :wink:

Cheers.

Hey duotive the next time please write a useful title man not just 'Hey', that way your problem can solve others problems ;)

Cheers.

i was dreaming… can u change the title for me? thanks

Why don’t you use a structure like this:

function icon($atts, $content=null) {
    extract(shortcode_atts(array(
      "type" => ''
    ), $atts));

    return '';

}

and use the types like:

[icon type=“1”]
[icon type=“2”]
[icon type=“3”]

Would be easier and a much cleaner code. :slight_smile: D.R.Y!!! (Don’t repeat yourself)

I’m just replying to say hi.

hi turkhitbox
thanks bebel will try it when at home :x