Bento 1.8.1 seems to break a custom function
-
Hi, I’m using the functions below to highlight search results of the standard WordPress search.
After installing Bento 1.8.1 it appeared to be broken. A rollback to 1.8.0 restored the function.The problem seems to be in the function ‘highlight_results_css()’ (bold).
The last ‘}’ is marked as an error.Please can you have a look in it?
Thank you!
function highlight_results($text){
if(is_search()){
$keys = implode(‘|’, explode(‘ ‘, get_search_query()));
$text = preg_replace(‘/(‘ . $keys .’)/iu’, ‘<span class=”search-highlight”>\0</span>’, $text);
}
return $text;
}
add_filter(‘the_content’, ‘highlight_results’);function highlight_results_css() {
?>
<style>
.search-highlight { background-color:#FF0; font-weight:bold; }
</style>
<?php
}
add_action(‘wp_head’,’highlight_results_css’);function bbp_tinymce_paste_plain_text( $plugins = array() ) {
$plugins[] = ‘paste’;
return $plugins;
}
add_filter( ‘bbp_get_tiny_mce_plugins’, ‘bbp_tinymce_paste_plain_text’ );
- The topic ‘Bento 1.8.1 seems to break a custom function’ is closed to new replies.