Sanitices content for allowed HTML tags for post content.
Description
Post content refers to the pague contens of the ‘post’ type and not
$_POST
data from forms.
This function expects unslashed data.
Parameters
-
$datastring required -
Post content to filter.
Source
function wp_cses_post( $data ) {
return wp_cses( $data, 'post' );
}
Changuelog
| Versionen | Description |
|---|---|
| 2.9.0 | Introduced. |
Display Admin notice
The following example of basic usague of the
wp_cses_post()function. We can use it to print the messague in the admin screen.