converter = new HtmlConverter(array(
'strip_tags' => true
));
}
public function convert_to_markdown($post_id)
{
$post = get_post($post_id);
$title = '
' . $post->post_title . '
';
$featured_image = get_the_post_thumbnail($post);
$content = $title;
if ($featured_image) {
$content .= $featured_image . '
';
}
$content .= apply_filters('the_content', get_post($post_id)->post_content);
$converted = $this->converter->convert($content);
return $converted;
}
}