How to Extend Colors, Styles and Button Variations

Using the extensive developer API baked into the core of our plugin its really easy to add new colours, sizes, variations and even styles to our custom button widget.

function function_name(){
}
add_filter('pixelmenu_filter_default_buttons', 'function_name');

Extending the default styles available

The following snippet adds a new style called ‘test’ that outputs the button class ‘pm-test-button’.

function prefix_extend_pixelmenu_buttons($buttons){  
	$style_name = 'test';
	$button_class = 'pm-test';

	// add the new style
	$buttons['styles'][ $style_name ] = $button_class;

	// return buttons
	return $buttons;

}
add_filter('pixelmenu_filter_default_buttons', 'prefix_extend_pixelmenu_buttons');

Don’t forget! You will need to add the new css styles for the button to work.

0 People Found This Helpful.

Viewed 148 times.