Hi there,
there are three parts to that shortcode that need to be unique – that is the shortcode_name
, the the_callback_function_name
of which you will see it twice in the code, and the custom_shortcode_hook
label.
function the_callback_function_name($atts, $content = null) {
ob_start();
do_action('custom_shortcode_hook');
return ob_get_clean();
}
add_shortcode('shortcode_name', 'the_callback_function_name');
As a note: that function is a bit of a hack, and i would only recommend using it in extreme circumstances. Not advisable to have lots of different ones as the extra db queries it will generate can soon mount up.