WordPress.org

Forums

SearchAutocomplete
Hyphens Sometimes = &#8211 (14 posts)

  1. jon509tech
    Member
    Posted 1 year ago #

    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/

  2. Gabe Shackle
    Member
    Plugin Author

    Posted 1 year ago #

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

  3. jon509tech
    Member
    Posted 1 year ago #

    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

  4. Gabe Shackle
    Member
    Plugin Author

    Posted 1 year ago #

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

  5. akh150
    Member
    Posted 1 year ago #

    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.

  6. akh150
    Member
    Posted 1 year ago #

    I mean " ' "

  7. Gabe Shackle
    Member
    Plugin Author

    Posted 1 year ago #

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

  8. akh150
    Member
    Posted 1 year ago #

    Thank you and thanks for your work

  9. Marko Heijnen
    Member
    Posted 1 year ago #

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

  10. Daedalon
    Member
    Posted 1 year ago #

    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 .

  11. Anita Hill
    Member
    Posted 1 year ago #

    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!)

  12. Daedalon
    Member
    Posted 1 year ago #

    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.

  13. Anita Hill
    Member
    Posted 1 year ago #

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

  14. duff_man
    Member
    Posted 10 months ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • SearchAutocomplete
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.