| 1 |
<?php |
| 2 |
|
| 3 |
class VP_WP_Util |
| 4 |
{ |
| 5 |
|
| 6 |
public static function kses_html($html) |
| 7 |
{ |
| 8 |
if( function_exists('wp_kses_allowed_html') ) { |
| 9 |
$allowed_post_html = wp_kses_allowed_html( 'post' ); |
| 10 |
} |
| 11 |
else { |
| 12 |
global $allowedposttags; |
| 13 |
$allowed_post_html = $allowedposttags; |
| 14 |
} |
| 15 |
$allow = array_merge($allowed_post_html, array( |
| 16 |
'link' => array( |
| 17 |
'href' => true, |
| 18 |
'rel' => true, |
| 19 |
'type' => true, |
| 20 |
), |
| 21 |
'style' => array( |
| 22 |
'type' => true, |
| 23 |
), |
| 24 |
)); |
| 25 |
return wp_kses($html, $allow); |
| 26 |
} |
| 27 |
|
| 28 |
public static function admin_notice($message, $is_error = false) |
| 29 |
{ |
| 30 |
if ($is_error) |
| 31 |
echo '<div class="error">'; |
| 32 |
else |
| 33 |
echo '<div class="updated">'; |
| 34 |
|
| 35 |
echo "<p><strong>$message</strong></p></div>"; |
| 36 |
} |
| 37 |
|
| 38 |
} |