WordPress.org

Support

Support » Plugins and Hacks » Hyphens Sometimes = &#8211

Hyphens Sometimes = &#8211

  • Still loving the plugin, just noticed one thing. I have hyphens “-” in some of my page titles. Sometimes when it is searching the drop down correctly shows the hyphen, and other times it show “&#8211” instead.

    It does not appear to be dependent on whether or not I’m typing.

    Edit:
    I have narrowed it down to when a space is the last thing typed. If the last thing typed was a space then the code will show up instead of the hyphen.

    http://wordpress.org/plugins/search-autocomplete/

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Gabe Shackle

    @hereswhatidid

    Do you have an example online somewhere I can try out to see this issue?

    Unfortunately no, its an internal site. But I have tested it repeatedly and if you have “status ” typed it will show “Status &#8211 Complete”, but if you only have “status” it will show “Status – Complete”.

    Very odd, but certainly not too painful to deal with by any means

    Plugin Author Gabe Shackle

    @hereswhatidid

    OK, I’ll take a look and try to recreate that on my end. Thanks!

    Hi,

    I’ve got the same problem.
    How not to make #8216 and #8217 appears on the search list.
    My posts titles contain “‘” and “-“.

    Thank you.

    I mean ” ‘ ”

    Plugin Author Gabe Shackle

    @hereswhatidid

    Thanks for those last couple comments, it narrows down the issue quite a bit.

    Thank you and thanks for your work

    It’s caused by ‘the_title’ filter. I don’t think you need to use it there.

    We noticed the same. We have an Events Manager event title with a hyphen. On the search autocomplete list it is displayed properly as a hyphen. When we click it and the title is auto-filled in the search box, the instead of a hyphen there is .

    I am getting ascii codes for single quotes showing up in the choices and in the search box after one is chosen. Would like to correct this, otherwise it looks a little goofy. (Or I am going to have to go back to 189 products and change something!)

    Thanks for Anita for the reminder of this standing issue and for Marko for the resolution. Tested and it works. Here’s how to do it:

    Open searchautocomplete.php, line 117:

    $linkTitle = apply_filters( 'the_title', $post->post_title );

    Replace it with:

    $linkTitle = $post->post_title;

    No more & #8221; & #8217; & #038; (without a space after &) in the search box after clicking a search result with a hyphen, quote or ampersand.

    Oh, yes, thank you SO much, Daedalon! Works beautifully!

    Thanks for the great plugin! Is there a way to solve this issue without modifying the plugin code?

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Hyphens Sometimes = &#8211’ is closed to new replies.