The post ID is not determined until after the post is entered in the database, so you need to be looking at includes/functions_posting.php:
Code: Select all
$sql = 'INSERT INTO ' . POSTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_data[POSTS_TABLE]['sql']);
$data['post_id'] = $db->sql_nextid();
THis is the first place where post ID is available.