- This topic has 0 replies, 1 contibutor, and was last updated 9 years ago by .
Viewing 1 post (of 1 total)
Question
Viewing 1 post (of 1 total)
- The question ‘Backslash Added to Apostrophe Issue’ is closed to new replies.
BuddyBoss Home – Web › Support Forums › General › BuddyPress (general issues) › Backslash Added to Apostrophe Issue
Tagged: activity, apostrophe, back slash, backslash
When posting any activity that includes an apostrophe, the site includes a backslash before the apostrophe when writing to the database. For example, “don’t” writes and reads as “don\’t”
I have magic_quotes turned off in php.ini and I added the following action to the child theme functions.php. I still can’t get rid of the unwanted backslash.
Any advice appreciated.
The action is as follows…
add_filter( 'get_topic_title', 'strip_the_title_slashes', 20, 2);
function strip_the_title_slashes( $title, $id ) {
return stripslashes( $title );
}
add_filter( 'get_post_text', 'strip_the_text_slashes', 20, 2);
function strip_the_text_slashes( $text, $id ) {
return stripslashes( $text );
}