skip to Main Content

Add a Shortcode to the Editor Options

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;

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