function table_of_contents_index($content, $post_id) { if (!class_exists('WebKitTableOfContents')) { return $content; } $content = WebKitTableOfContents::parse($content); WebKitTableOfContents::wp_insert_post($post_id); return $content; }