How to Call Publish Function?
-
I have 1100 posts that have a single image. The image links are broken. To fix them, I have to save each post manually — open the post edit page and then click the Publish button — in order to reset the image link.
I’m wondering if clicking the Publish button calls a function that processes the page content in addition to updating the status. If so, I could programmatically call the function for each of my 1100 posts.
It looks like wp_update_post() might do the trick? My question is whether or not that function will process the page content or only update the publication status?
Processing the page content, for example, updating any image attachments (using ACF in this case) appears to solve the problem by resetting the link from an attachment ID to an image URL.
Appreciate any insight on how WordPress processes posts, with function(s) and what actually happens with code when a post is published.
- The topic ‘How to Call Publish Function?’ is closed to new replies.