Title: bug with quotation marks
Last modified: August 24, 2016

---

# bug with quotation marks

 *  [lino4000](https://wordpress.org/support/users/lino4000/)
 * (@lino4000)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/bug-with-quotation-marks/)
 * I noticed this when I tried to put classes in the html tag.
    When I add ” the
   result is & # 8221; <- without spaces
 * [https://wordpress.org/plugins/html-in-widget-titles/](https://wordpress.org/plugins/html-in-widget-titles/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [harnis](https://wordpress.org/support/users/harnis/)
 * (@harnis)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/bug-with-quotation-marks/#post-5989129)
 * I noticed the same thing [@lino4000](https://wordpress.org/support/users/lino4000/)!
   
   To bad you’ve gotten no answer.
 * If you write [span class=habla]Text[/span] the plugin adds the ” ” but in my 
   case, maybe yours as well, I want to add two classes, like [span class=habla 
   blabla]Text[/span] but that does not work, then habla gets the ” ” but the blabla
   class ends up outside of the quotations.
 * Some support here would be great!
 *  [abumalick](https://wordpress.org/support/users/abuhurayra/)
 * (@abuhurayra)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/bug-with-quotation-marks/#post-5989131)
 * The plugin don’t add the quotation mark, it’s wordpress that add it.
    The code
   of this plugin is deadly simple. I tried too to add to class for this one : <
   span class=”glyphicon glyphicon-bullhorn” aria-hidden=”true”></span>
 * But I could do it by writing this :
    <span class=glyphicon aria-hidden=true><
   span class=glyphicon-bullhorn aria-hidden=true></span></span>
 * If you find another turnaround, please share
 *  Plugin Author [jabelone](https://wordpress.org/support/users/jabelone/)
 * (@jabelone)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/bug-with-quotation-marks/#post-5989132)
 * Sorry for the very delayed reply, I forgot I had made this plugin! I’ll try to
   keep an eye on here and keep it updated where possible but I have little use 
   for this plugin now. It was originally meant to just allow links to be placed
   in the title but it should have worked with any HTML. WordPress is a massively
   complicated beast when it comes to stuff like this.
 * As @abumalick said this plugin is ridiculously simple – the readme file has more
   lines! This is both advantageous, and disadvantageous. The plugin does nothing
   else so shouldn’t really have bugs. However the other way of looking at it, is
   it doesn’t do anything fancy, so it could have unexpected results with different
   themes/plugins.
 * What version of WordPress are you running?
    What other plugins are you using?
   What theme are you using? Does it still happen with the 2015 or 2016 theme? Does
   it still happen when you disable _every_ other plugin?
 * I’ve found that it occurs with any “space” or whitespace character inserted in
   there. It’s interesting that if you use ” ” it doesn’t mind it but of course 
   you can’t use that to separate two classes.
 *  Plugin Author [jabelone](https://wordpress.org/support/users/jabelone/)
 * (@jabelone)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/bug-with-quotation-marks/#post-5989133)
 * For the time being, the workaround @abumalick suggested appears to work. You 
   just have to add the second class as another span inside the current one and 
   don’t use ” or ‘ in it. So for example:
 * [span class=class1][span class=class2]Your Content[/span][/span]
 * I don’t think that workaround will work in all CSS situations, so if it doesn’t
   then you’ll just have to live with one class for the time being.
 *  [abumalick](https://wordpress.org/support/users/abuhurayra/)
 * (@abuhurayra)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/bug-with-quotation-marks/#post-5989135)
 * Here is a script that works :
 * >     ```
   >     <?php
   >     function icon_widget_title( $title ) {
   >     //HTML tag opening/closing brackets
   >     $title = str_replace( '[', '', $title );
   >     // [test]
   >     $title = str_replace( 'camera-retro]', '<i class="fa fa-camera-retro"></i>', $title );
   >     return $title;
   >     }
   >     add_filter( 'widget_title', 'icon_widget_title' );
   >     ```
   > 
 * You have to add the double quotes in your plugin to make this work.
 *  [abumalick](https://wordpress.org/support/users/abuhurayra/)
 * (@abuhurayra)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/bug-with-quotation-marks/#post-5989136)
 * I made this for my use with glyphicons and font awesome, if someone need it.
 *     ```
       <?php
       function icon_widget_title( $title ) {
       //HTML tag opening/closing brackets
       	//$title = str_replace( '[', '', $title );
       	$stop = strpos($title, "]");
       	if ($stop){
       		$icon = substr($title, 1, $stop);
       		$title = '<span class="'.substr($title, 1, $stop).'" aria-hidden="true"></span>'.substr($title, $stop+1);
       	}
       	return $title;
       }
       add_filter( 'widget_title', 'icon_widget_title' );
       ```
   
 *  [abumalick](https://wordpress.org/support/users/abuhurayra/)
 * (@abuhurayra)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/bug-with-quotation-marks/#post-5989137)
 * Without the bug:
 *     ```
       <?php
       function icon_widget_title( $title ) {
       	//Take the icon classes that is inside brackets and put it in a span tag
       	// Exemple [glyphicon glyphicon-bullhorn]My Title
       	//Or [fa fa-camera-retro]Widget Title
       	$stop = strpos($title, "]");
       	if ($stop){
       		$title = '<span class="'.substr($title, 1, $stop-1).'" aria-hidden="true"></span>'.substr($title, $stop+1);
       	}
       	return $title;
       }
       add_filter( 'widget_title', 'icon_widget_title' );
       ```
   
 * Base of the script from:
    [http://jasonbradley.me/bootstrap-icons-in-widget-titles/#comment-270661](http://jasonbradley.me/bootstrap-icons-in-widget-titles/#comment-270661)
 *  Plugin Author [jabelone](https://wordpress.org/support/users/jabelone/)
 * (@jabelone)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/bug-with-quotation-marks/#post-5989138)
 * Looks great, thanks for that. I’ll have a proper look (and try to implement) 
   in a few days time as I’m quite busy at the moment.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘bug with quotation marks’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/html-in-widget-titles.svg)
 * [HTML Widget Titles](https://wordpress.org/plugins/html-in-widget-titles/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/html-in-widget-titles/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/html-in-widget-titles/)
 * [Active Topics](https://wordpress.org/support/plugin/html-in-widget-titles/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/html-in-widget-titles/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/html-in-widget-titles/reviews/)

 * 8 replies
 * 4 participants
 * Last reply from: [jabelone](https://wordpress.org/support/users/jabelone/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/bug-with-quotation-marks/#post-5989138)
 * Status: not resolved