Skip to:

Smart Quote issue – effecting Buddypress extras only.

  • Avatar of JRCDyer


    (using WordPress 3.5 with BuddyPress 1.6.3)

    For some reason the left curly quotation is being displayed as a right curly quotation. However, it’s only happening in the BuddyPress extras, like Activity and private messaging. I’ve spent half the day trying to figure out how to fix this without any luck, as every solution I’ve found applies to WordPress and not BuddyPress (as in, has no effect).

    I’m not stuck on the curly quotes, so if the solution is to disable them completely I’d definitely go for that. All I need is for someone to point me in the right direction.

    If you’d like to see the problem in action, here’s a link to the website in development:

Viewing 9 replies - 1 through 9 (of 9 total)
  • could be a language setting thing have you double checked that?

    Avatar of JRCDyer


    Yup, that was one of the first things I checked. It’s set to ‘en’, charset is “utf-8″

    the only one that looks wrong to me is the last entry the earlier entries appear correct.

    TurtleBoy wrote a new post, “Son Of Rambow” (2007)

    Avatar of JRCDyer


    Yes, all of the quotes within the activity header are straight quotes. However, the quotes within the activity body are smart quotes.


    Correction, the activity header’s quotes are smart quotes and are still being parsed correctly. They render both the 8820 and 8821 on either side of the quote. However, in the activity’s body it’s spitting out two 8821s…

    That’s kind of messed up.

    Avatar of Paul Gibbs
    Paul Gibbs


    Hmm.. do you know how to use MySQL? If so, looking up one of those activities in the DB table (wp_bp_activity) and seeing what the quote mark is written us, would be helpful.

    Avatar of JRCDyer


    The content: \”Testing quotes again\”
    The action: “Son Of Rambow” (2007)

    Guess I was right initially. The activity header is without smart quotes :D

    Avatar of danbpfr


    Hi guys,

    you can try to deactivate the appropriate filter concerning the place who the unwanted output shows.

    You have in each BP folder a filter file where all the existing active filters are listed.

    Once you found one who concern your situation, simply deactivate it.

    Open your child theme functions.php, copy in the filter taken from one of the above file and change the word add_filter to remove_filter



    Avatar of JRCDyer


    Aha! You’re a genius! I didn’t realize there were so many filter files. I was only looking in the functions.php xD

    Instead of removing the filters completely, I decided to go with a replace because some people freak out when their em-dashes don’t look how they should :P In case anyone else ever has this problem, here’s what I did to resolve it:

    `function removesmartquotes($content) {
    $content = str_replace(‘&# 8220;’, ‘& quot;’, $content);
    $content = str_replace(‘&# 8221;’, ‘& quot;’, $content);
    $content = str_replace(‘&# 8216;’, ‘&# 39;’, $content);
    $content = str_replace(‘&# 8217;’, ‘&# 39;’, $content);

    return $content;

    add_filter(‘the_content’, ‘removesmartquotes’);
    add_filter( ‘bp_get_activity_action’, ‘removesmartquotes’);
    add_filter( ‘bp_get_activity_content_body’, ‘removesmartquotes’);
    add_filter( ‘bp_get_activity_content’, ‘removesmartquotes’);
    add_filter( ‘bp_get_activity_parent_content’, ‘removesmartquotes’);
    add_filter( ‘bp_get_activity_latest_update’, ‘removesmartquotes’);
    add_filter( ‘bp_get_activity_latest_update_excerpt’, ‘removesmartquotes’);
    add_filter( ‘bp_get_message_notice_subject’, ‘removesmartquotes’);
    add_filter( ‘bp_get_message_notice_text’, ‘removesmartquotes’);
    add_filter( ‘bp_get_message_thread_subject’, ‘removesmartquotes’);
    add_filter( ‘bp_get_message_thread_excerpt’, ‘removesmartquotes’);
    add_filter( ‘bp_get_the_thread_message_content’, ‘removesmartquotes’);`

    Important: I added a space between the &# and 8220/21 as well as & quot because they were turning into real quotes in the final post :( So if anyone uses this, make sure to remove the spaces.

    Thanks a bunch to the both of you. I wouldn’t have figured it out with your help.

    Avatar of Ypswytch


    I also noticed that the left curly quote was not correct in the activity stream, and curly quotes can cause other problems. To remove them I added the following to my functions.php in my child theme:

    remove_filter('bp_get_activity_content_body', 'wptexturize');
Viewing 9 replies - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.