Merhaba

Ben başlıkların otomatik etiket olması için bir kod ekliyorum functions.php dosyasına ama hatalar alıyorum. php den çok iyi anlamıyorum bu kodu functions.php dosyasına sorunsuz bir şekilde nasıl ekleyebilirim?

Ekleyeceğim kod..

function yg_auto_tag_append($post_id, $post) {
$tag_words = explode(" ", preg_replace("([^A-Za-z0-9üğıişçöÜĞİŞÇÖ]+)", " ", $post->post_title));
$tags = array();
foreach ($tag_words as $tag) {
if (strlen($tag)> 4) $tags[] = $tag;
}
if ($tags) wp_set_post_tags($post_id, $tags, true);
}
add_action('save_post', 'yg_auto_tag_append', 10, 2);