How can we retrieve the md content through rest api?
I'm trying to get the post content in markdown through the rest api, but I'm unable to do this
I've tried
$wp_post = get_page_by_title('post title', OBJECT, 'post');
$content = get_post_field('post_content_filtered', $wp_post->ID, 'edit'));
But I receive data like this
"<hr />
<h2>type: 'recipe'
date: 2019-12-20
...
Can I fetch the data as I can see it with the plugin editor?
The post content needs to be decoded. I will take a look at REST API for this part. Please wait a few days. Thanks.
*Thanks for replying so fast
Decoding as this
$wp_post = get_page_by_title('post title', OBJECT, 'post');
$content = html_entity_decode(get_post_field('post_content_filtered', $wp_post->ID, 'edit'), ENT_QUOTES | ENT_HTML5, 'UTF-8'));
seems to work
But looking at the comments at https://www.php.net/manual/en/function.html-entity-decode.php doesn't seem to be a standardized solution (?)
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 2 days.
This issue was closed because it has been inactive for 14 days since being marked as stale.