I am a newbie to WP plugin development. I am trying to develop a wordpress plugin that would that translate text from English to some X language. I have the required API for translation. I want to extract only the post content from website, send it to the API and get the translated text. Here the translated text should be replaced by the original post content on the website. I am not sure how to fetch the post contents and send it to API and replace the translated content with original as in Google language translator plugin.
Any help would be greatly appreciated. Thanks.