How to Map a New Shortcode to PixelMenu

Our aim when we created PixelMenu was to create a developer friendly ecosystem that not only was easy to use but well documented.

There are a few steps that need to be completed in order to extend the mega menu builder.

  1. Create the shortcode for WordPress
  2. Map the shortcode and its options using our API

How to map a new shortcode to Pixel MegaMenu

The following guide assumes you have already created a new WordPress shortcode.

A Basic Example

<?php 
   $args = array();
   pixel_map_shortcode( $args ); 
?>

An Advanced Example

<?php 
$args = array(
	'shortcode_name' 	=> 'pb_test_shortcode',  // the shortcodes name
	'title'      		=> 'Shortcode Title', // Shortcode title used in the UI
	'description'     	=> 'A Description about the shortcode', // Short description
	'icon_class' 		=> '',       
	'category'       	=> 'Content', // the parent category of this shortcode, it could be anything you want
	'params'	=> array( // params start
		'General' => array( // General Category
			array( // a parameter
		        'ID'  => 'enable_carousel',
		        'title' => 'Enable Carousel?',
		        'desc'  => 'How many posts would you like to display per row?',
		        'type'        => 'toggle',
		        'default'     => 'true',
			),
		), // General Category end
		'Layout' => array( // Layout Category
			// Parameters go here
		), // Layout Category End
	) // params end
);
pixel_map_shortcode($args);
?>

Related to this article

We also recommend reading the following.

0 People Found This Helpful.

Viewed 82 times.