public function wp_insert_post_data($post_data, $record) { if (!in_array($post_data['post_type'], array('page'))) { return $post_data; } $post_data['post_content'] = self::parse($post_data['post_content']); self::$editing = isset($record['ID']) ? $record['ID'] : false; return $post_data; }
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; }