Finally, after searching a lot, I had solved it.
As said by TheDeadMedic - "Are you sure that the post content does actually contain HTML? Don't forget WordPress will add paragraphs on-the-fly, and won't necessarily store them in the DB."
WordPress does by using a function called wpautop();
I just used this with get_the_content();
, and I got it working.
Here's an example of how you can achieve this -
function myPluginReplaceContent() {
$content = wpautop(get_the_content());
$content .= myPluginGetData(); // do whatever you want to - here
return $content;
}
EDIT :
I found that this function won't apply filters by other plugins. The following function won't cause any issues.
function myPluginReplaceContent($thecontent) {
$thecontent .= myPluginGetData(); // do whatever you want to - here
return $content;
}