Last active
January 12, 2016 07:28
-
-
Save ryanburnette/0fc9b9ab1eb41877ffd3 to your computer and use it in GitHub Desktop.
WordPress filters for converting to and from Markdown using WP-Markdown plugin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// functions.php | |
if ( function_exists(wpmarkdown_markdown_to_html) && function_exists(wpmarkdown_html_to_markdown) ) { | |
function markdown_to_html_func($content) { | |
if ( function_exists('wpmarkdown_markdown_to_html') ) { | |
return wpmarkdown_markdown_to_html($content); | |
} | |
return $content; | |
} | |
add_filter('markdown_to_html','markdown_to_html_func'); | |
function html_to_markdown_func($content) { | |
if ( function_exists('wpmarkdown_html_to_markdown') ) { | |
return wpmarkdown_html_to_markdown($content); | |
} | |
return $content; | |
} | |
add_filter('html_to_markdown','html_to_markdown_func'); | |
} | |
?> |
@manojhl Stephen didn't see the need to put this into the core the last time I spoke with him about it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Its better to have it inside the wp-markdown core itself..... :D