Allow HTML in Author Bios
Keeps links and basic formatting in the Biographical Info field for users who are trusted with unfiltered HTML, instead of stripping it.
Opens WPIDE on
Code
add_action( 'init', function () {
if ( current_user_can( 'unfiltered_html' ) ) {
remove_filter( 'pre_user_description', 'wp_filter_kses' );
add_filter( 'pre_user_description', 'wp_filter_post_kses' );
}
} );
Notes
Bios are filtered with the same rules as post content, so scripts are still removed.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.