title_save_pre on post publish
The filter title_save_pre runs before the post is written to the database, and also before any of its post meta is saved to the database. So get_post_meta at this point will be blank for the first run, and always return ‘old’ data. To correct this you’ll want to hook into save_post and update the post … Read more