Blog.php
//Image Fix | |
$content = str_replace('src="/wp-content/"', 'src="https://viastudio.com/wp-content/"', $content); | |
//Gist | |
$content = preg_replace('/(?:https?:\/\/)?(?:www\.)?gist.github\.com([^\n]+)$/sm', '<gist src="$0"></gist>', $content); | |
//Youtube | |
$content = preg_replace('/(?:https?:\/\/)?(?:www\.)?youtube\.com\/watch\?v=([^\n]+)$/sm', '<videoblock src="$0"></gist>', $content); | |
//Apply the content filters | |
$content = apply_filters('the_content', $content); | |
//Remove empty paragraphs | |
$content = str_replace('<p></p>', '', $content); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment