Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * clean curly quotes and other bad characters
- */
- function clean_characters($post_id) {
- $post_id = (int) $post_id;
- if (!$post_id)
- return;
- global $wpdb;
- $wpdb->query('UPDATE wp_posts SET
- post_content = REPLACE(post_content, "’", "\'")
- WHERE ID = ' . $post_id);
- }
- add_action( 'save_post', 'clean_characters', 1000 );
- ?>
Add Comment
Please, Sign In to add comment