post_title; $pattern = "/^links for \d{4}-\d{2}-\d{2}$/i"; // Check if the title matches the delicious daily post title format if (preg_match($pattern, $title)) { // Retrieve the date from the title list($year, $month, $day) = sscanf($title, "links for %d-%d-%d"); $date = mktime (0, 0, 0, $month, $day, $year); // Format the date to my wishes $formatted_date = $day . ' ' . __(date('F', $date)) . ' ' . $year; // A new title $post->post_title = 'Linkdump van ' . $formatted_date; // A new slug/name for the post $post->post_name = sanitize_title($post->post_title); // Set a decent excerpt $post->post_excerpt = 'De links die ik verzamelde voor ' . $formatted_date . '.'; // Store the changed post wp_update_post($post); } } add_action('publish_post', 'format'); ?>