lookout adlı üyeden alıntı: mesajı görüntüle
Sayfanın oluşturulmadan önce kontrolü yapılması gerekiyor.

$translation_text = trim($translation->translated_text);

// Generate initial post slug
$post_slug = sanitize_title('Translation: ' . $translation_text);
$post_slug = mb_substr($post_slug, 0, 50);

// Check if a page with the same slug already exists
$existing_page = get_page_by_path($post_slug);

// If a page with the same slug exists, do not create a new page
if ($existing_page) {
    return;
}
            
            // Split translation text into words
            $words = explode(' ', $translation_text);
            
            // Get the first 5 words or less for the title
            $title_words = array_slice($words, 0, 5);
            $post_title = implode(' ', $title_words);

            // Limit title to maximum 45 characters
            $post_title = mb_substr($post_title, 0, 45);
            
            $tags = array();
            
            // Calculate the remaining characters for tags
            $remaining_chars = 50;
            
            // Determine the tag words based on the remaining characters and word count
            foreach ($words as $word) {
                if ($remaining_chars >= mb_strlen($word)) {
                    $tags[] = sanitize_title($word);
                    $remaining_chars -= mb_strlen($word) + 1; // Include space character
                } else {
                    break;
                }
            }

Şöyle bir kontrol işlemi var aslında, ama gece yatıyorum sabah kalkıyorum mükerrer sayfalar oluşmuş oluyor. neye göre tetiklendiğini de anlamadım. önbellek sorunu vs vardır diye optimizasyon eklentisini de kaldırdım sorun devam ediyor