Just out of curiosity what would be the reason the modified date needs to be updated to the same as the published date? Is there a specific reason? Since the post is not actually modified at the time of going live, then it would not update. That is how it is supposed to work unless you have a specific reason to change this functionality however you posted in “fixing wordpress” so I am assuming you think otherwise?
Ah apologies, I probably meant to post it in developing with WordPress. Do let me know if I should make this question on the developing with WordPress section instead.
The reason is that the date I display for my posts and the date I sort posts by in the blog view is with the modified date not the post date. The problem with this, of course, is that the date shown on my website is much earlier than the date it was actually published since I show modified date. It also gets sorted wrong due to the older modified date.
Furthermore, I use a plugin that uses the published date and modified date to provide structured data for the post page automatically. And with the plugin, the structured data shows dateCreated as newer than dateModified, which is wrong as well I believe.
Anyways, I guess the main thing I care about is making the modified date set to now as soon as a scheduled post gets published. Basically marking a post being changed from scheduled status to published status as a “modified action”. Ideally if you can provide an example function I can put into functions.php, it would be much appreciated!