Skip to content

Instantly share code, notes, and snippets.

@gouten5010
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gouten5010/9bf260359f55175a37b0 to your computer and use it in GitHub Desktop.
Save gouten5010/9bf260359f55175a37b0 to your computer and use it in GitHub Desktop.
It to remove the ASCII code from the article that was posted in WordPress. And save.
function remove_ascii( $data ) {
$ascii = '/[\x08]/';
$data['post_content'] = preg_replace($ascii, '', $data['post_content']);
return $data;
}
add_filter( 'wp_insert_post_data' , 'remove_ascii' , 10, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment