[Rate] this plugin or [Donate]. Version: 3.2 Author: Narin Olankijanan Author URI: http://dev.coziplace.com License: GPLv2 */ add_action('save_post', 'dk_save_post'); function dk_save_post(){ $tags = get_tags( array('hide_empty' => false) ); $post_id = get_the_ID(); $post_content = get_post($post_id)->post_content; $post_content = strtolower($post_content); preg_match_all('/#(.*?)[ \?\.\:\;,]/',$post_content,$news,PREG_PATTERN_ORDER); if ($news[1]) { foreach ($news[1] as $new) { wp_set_post_tags( $post_id, $new, true); } } if ($tags) { foreach ( $tags as $tag ) { if ( strpos($post_content, strtolower($tag->name)) !== false) wp_set_post_tags( $post_id, $tag->name, true ); } } } /* EOF */