Text Control Config" in your admin section // Arrays for the select tags we use often $format_select = array( 'wpautop' => 'Default (wpautop)', 'textile1' => 'Textile 1', 'textile2' => 'Textile 2', 'markdown' => 'Markdown', 'nl2br' => 'nl2br', 'none' => 'No Formatting' ); $encoding_select = array( 'wptexturize' => 'Default (wptexturize)', 'smartypants' => 'Smarty Pants', 'none' => 'No Character Encoding' ); function output_selects($dotext, $dochar, $format_var, $encoding_var) { global $format_select, $encoding_select; echo('\n"); echo('\n"); } function tc_post($text) { global $id; // Check if meta data already exists, otherwise use the defaults $do_text = get_post_meta($id, '_tc_post_format', true); if (!$do_text) $do_text = get_option('tc_post_format'); $do_char = get_post_meta($id, '_tc_post_encoding', true); if (!$do_char) $do_char = get_option('tc_post_encoding'); $text = tc_post_process($text, $do_text, $do_char); return $text; } function tc_comment($text) { $do_text = get_option('tc_comment_format'); $do_char = get_option('tc_comment_encoding'); $text = tc_post_process($text, $do_text, $do_char); return $text; } function tc_post_process($text, $do_text='', $do_char='') { if($do_text == 'textile2') { require_once('text-control/textile2.php'); $t = new Textile(); $text = $t->process($text); } else if($do_text == 'textile1') { require_once('text-control/textile1.php'); $text = textile($text); } else if($do_text == 'markdown') { require_once('text-control/markdown.php'); $text = Markdown($text); } else if($do_text == 'wpautop') { $text = wpautop($text); } else if($do_text == 'nl2br') { $text = nl2br($text); } else if($do_text == 'none') { $text = $text; } else { $text = wpautop($text); } if($do_char == 'smartypants') { require_once('text-control/smartypants.php'); $text = SmartyPants($text); } else if($do_char == 'wptexturize') { $text = wptexturize($text); } else if($do_char == 'none') { $text = $text; } else { $text = wptexturize($text); } return $text; } remove_filter('the_content', 'wpautop'); remove_filter('the_content', 'wptexturize'); add_filter('the_content', 'tc_post'); remove_filter('the_excerpt', 'wpautop'); remove_filter('the_excerpt', 'wptexturize'); add_filter('the_excerpt', 'tc_post'); remove_filter('comment_text', 'wpautop', 30); remove_filter('comment_text', 'wptexturize'); add_filter('comment_text', 'tc_comment'); function tc_post_option_page() { global $wpdb; ?>

Text Control Settings

Set up the default settings for your blog text formatting.

Post/Excerpt formatting updated.

'; } if( $_POST['tc_comment_format'] && $_POST['tc_comment_encoding'] ) { // set the comment formatting options update_option('tc_comment_format', $_POST['tc_comment_format']); update_option('tc_comment_encoding', $_POST['tc_comment_encoding']); echo '

Comment formatting updated.

'; } ?>
Posts & Excerpts

These will set up what the blog parses posts with by default unless over ridden on a per-post basis.

Comments

All comments will be processed with these:

Text Control

Format this post with: