Created
September 29, 2016 19:13
-
-
Save meloniq/d1e8b506ec262afbeb199eea76f8aa0b to your computer and use it in GitHub Desktop.
Strip all HTML tags from user profile description field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Strip all HTML tags from user profile description field. | |
* | |
* @param int $user_id | |
* | |
* @return void | |
*/ | |
function childtheme_strip_html_from_user_profile_description( $user_id ) { | |
if ( ! isset( $_POST['description'] ) ) { | |
return; | |
} | |
$user_id = wp_update_user( array( | |
'ID' => $user_id, | |
'description' => wp_strip_all_tags( $_POST['description'] ), | |
) ); | |
} | |
add_action( 'personal_options_update', 'childtheme_strip_html_from_user_profile_description', 13, 1 ); |
Hi there,
Both solutions aren't working in my case, any there any workarounds please?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This would disable ALL html.