Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This is an example plugin that creates 2 color schemes for use with MP6, using the new `mp6_add_admin_colors` function.
<?php
/**
* Plugin Name: MP6 Color Scheme
*/
function kd_mp6_add_colors() {
// Check that MP6 exists and that our new function exists
if ( ! defined( 'MP6' ) || ! function_exists( 'mp6_add_admin_colors' ) )
return;
mp6_add_admin_colors( 'sunset', array(
'label' => 'Sunset',
'palette' => array( '#b43c38', '#cf4944', '#dd823b', '#ccaf0b' ),
'icon' => array( 'base' => '#f3f1f1', 'focus' => '#fff', 'current' => '#fff' ),
'admin_path' => plugin_dir_path( __FILE__ ) . "sunset/admin-colors.css",
'admin_url' => plugins_url( "sunset/admin-colors.css", __FILE__ ),
) );
mp6_add_admin_colors( 'navy', array(
'label' => 'Navy',
'palette' => array( '#25282b', '#363b3f', '#69a8bb', '#e14d43' ),
'icon' => array( 'base' => '#f1f2f3', 'focus' => '#fff', 'current' => '#fff' ),
'admin_path' => plugin_dir_path( __FILE__ ) . "navy/admin-colors.css",
'admin_url' => plugins_url( "navy/admin-colors.css", __FILE__ ),
) );
}
add_action( 'admin_init' , 'kd_mp6_add_colors' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment