Snippets: Add Custom Shortcode to the Total Shortcodes Editor Dropdown Button

add_filter( 'wpex_shortcodes_tinymce_json', function( $data ) {

	// Add your custom shortcode
	$data['shortcodes']['my_custom_shortcode'] = array(
		'text' => __( 'Custom Shortcode', 'total' ),
		'insert' => '[custom_shortcode parameter1="value"]',

	// Return data
	return $data;

} );


Version Required:4.0++

Snippet Type: PHP

Posted Under: Other

All PHP snippets should be added via a child theme's functions.php file or via the Code Snippets Plugin (or alternative plugin)