[Rate] this plugin or [Donate]. Version: 4.0 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_title = get_post($post_id)->post_title; $d = strtolower($post_title.' '.$post_content); $options = get_option('aat_options'); $whole = $options['whole']; if ($whole=='checked') { $x = array(',','.','?','"'); $dummy = str_ireplace($x,'',$d); $m = explode(' ',$dummy); if ($tags) { foreach ( $tags as $tag ) { foreach($m as $n) { if (strtolower($tag->name)==$n) wp_set_post_tags( $post_id, $tag->name, true ); } } } } else { if ($tags) { foreach ( $tags as $tag ) { if ( strpos($d, strtolower($tag->name))) wp_set_post_tags( $post_id, $tag->name, true ); } } } } add_action( 'admin_menu', 'aat_create_menu'); function aat_create_menu() { add_options_page( 'Auto-add-tags', 'Auto-add-tags','manage_options', 'gus', 'aat_menu_page'); } function aat_menu_page() { ?>