syntax highlighting
-
I have set up some shortcodes in my functions.php to be used in the editor and would love to highlight them in the editor.
Is that possible and if so: how?Here is what I set up in my functions.php:
/* Open Div */ add_shortcode('div', 'be_div_shortcode'); function be_div_shortcode($atts) { extract(shortcode_atts(array('class' => '', 'id' => '' ), $atts)); $return = '<div'; if (!empty($class)) $return .= ' class="'.$class.'"'; if (!empty($id)) $return .= ' id="'.$id.'"'; $return .= '>'; return $return; } /* Close Div */ add_shortcode('end-div', 'be_end_div_shortcode'); function be_end_div_shortcode($atts) { return '</div>'; } function shortcode_empty_paragraph_fix( $content ) { $array = array ( '<p>[' => '[', ']</p>' => ']', ']<br />' => ']' ); $content = strtr( $content, $array ); return $content; } add_filter( 'the_content', 'shortcode_empty_paragraph_fix' );
Thanx for any answer
mxmanuel
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘syntax highlighting’ is closed to new replies.