I have a site that is performance critical. Doing shortcodes I thought about the time the server needs to parse and return the content, instead to allow some HTML (<div class="redletter">
) to go through the TinyMCE editor. In the meantime, my code for that is:
// [redletter]Content[/redletter]
add_shortcode('redletter', 'redletter_do');
function redletter_do($atts, $content = null) {
return '<div class="redletter"' . do_shortcode($content) . '</div>';
}
Performance critical or not, I think that nothing could beat a button to allow a <div>
pass through directly in the visual editor and show - like it does when you press the [B] button to make <strong>
.
So, i'm between keeping the shortcode, or making a TinyMCE button for <div class="redletter">
and showing the result in the visual editor.