Skip to content

Instantly share code, notes, and snippets.

@simplistik
Last active December 30, 2015 23:39
Show Gist options
  • Save simplistik/7901838 to your computer and use it in GitHub Desktop.
Save simplistik/7901838 to your computer and use it in GitHub Desktop.
<?php
class Client extends Setup
{
public function __construct()
{
add_filter('process_markdown', array($this, 'process_markdown'));
add_filter('tablepress_cell_content', array($this, 'process_markdown'));
}
public function process_markdown($text)
{
if ( in_array($text, array('#colspan#', '#rowspan#', '#span#')) ) return $text;
if ( file_exists(THEMEEXTENSIONS . '/functions/parsedown.php') )
require_once(THEMEEXTENSIONS . '/functions/parsedown.php');
else
return $text;
$markdown = Parsedown::instance()->parse($text);
return $markdown;
}
}
new Client;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment