| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: Hotfix |
| 4 |
Description: Provides "hotfixes" for annoying WordPress bugs, so you don't have to wait for the next WordPress core release. Keep the plugin updated! |
| 5 |
Version: 0.2 |
| 6 |
Author: Mark Jaquith |
| 7 |
Author URI: http://coveredwebservices.com/ |
| 8 |
*/ |
| 9 |
|
| 10 |
function wp_hotfix_init() { |
| 11 |
global $wp_version; |
| 12 |
|
| 13 |
switch ( $wp_version ) { |
| 14 |
case '3.0.5' : |
| 15 |
$hotfixes = array( '305_comment_text_kses' ); |
| 16 |
break; |
| 17 |
} |
| 18 |
|
| 19 |
foreach ( $hotfixes as $hotfix ) { |
| 20 |
call_user_func( 'wp_hotfix_' . $hotfix ); |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
add_action( 'init', 'wp_hotfix_init' ); |
| 25 |
|
| 26 |
/* And now, the hotfixes */ |
| 27 |
|
| 28 |
function wp_hotfix_305_comment_text_kses() { |
| 29 |
remove_filter( 'comment_text', 'wp_kses_data' ); |
| 30 |
if ( is_admin() ) |
| 31 |
add_filter( 'comment_text', 'wp_kses_post' ); |
| 32 |
} |
| 33 |
|