public function addAdminTheme($key, $args)
    {
        // Check args
        if (empty($args)) {
            return;
        }

        $defaults = [
            'name'      => $key,
            'url'       => $key,
            'colors'    => [],
            'icons'     => []
        ];

        // Create options with args
        $opts = array_merge($defaults, $args);

        // Check options
        if (!isset($opts['name'], $opts['url'], $opts['colors'])) {
            return;
        }

        // Works on colors
        if (3 > count($opts['colors'])) {
            $opts['colors'][1] = isset($opts['colors'][1]) ? $opts['colors'][1] : $opts['colors'][0];
            $opts['colors'][2] = isset($opts['colors'][2]) ? $opts['colors'][2] : $opts['colors'][1];
        }

        // Works on icons
        if (isset($opts['icons'])) {
            $opts['icons'] = [
                'base'      => isset($opts['icons']['base']) ? $opts['icons']['base'] : $opts['colors'][0],
                'focus'     => isset($opts['icons']['focus']) ? $opts['icons']['focus'] : $opts['colors'][1],
                'current'   => isset($opts['icons']['current']) ? $opts['icons']['current'] : $opts['colors'][2],
            ];
        } else {
            $opts['icons'] = [
                'base'      => $opts['colors'][0],
                'focus'     => $opts['colors'][1],
                'current'   => $opts['colors'][2],
            ];
        }

        // Add custom admin theme
        wp_admin_css_color($key, $opts['name'], $opts['url'], $opts['colors'], $opts['icons']);
    }
public function addAdminTheme($key, $args)
    {
        // Check args
        if (empty($args)) {
            return;
        }

        $defaults = [
            'name'      => $key,
            'url'       => $key,
            'colors'    => [],
            'icons'     => []
        ];

        // Create options with args
        $opts = array_merge($defaults, $args);

        // Check options
        if (!isset($opts['name'], $opts['url'], $opts['colors'])) {
            return;
        }

        // Works on colors
        if (3 > count($opts['colors'])) {
            $opts['colors'][1] = isset($opts['colors'][1]) ? $opts['colors'][1] : $opts['colors'][0];
            $opts['colors'][2] = isset($opts['colors'][2]) ? $opts['colors'][2] : $opts['colors'][1];
        }

        // Works on icons
        if (isset($opts['icons'])) {
            $opts['icons'] = [
                'base'      => isset($opts['icons']['base']) ? $opts['icons']['base'] : $opts['colors'][0],
                'focus'     => isset($opts['icons']['focus']) ? $opts['icons']['focus'] : $opts['colors'][1],
                'current'   => isset($opts['icons']['current']) ? $opts['icons']['current'] : $opts['colors'][2],
            ];
        } else {
            $opts['icons'] = [
                'base'      => $opts['colors'][0],
                'focus'     => $opts['colors'][1],
                'current'   => $opts['colors'][2],
            ];
        }

        // Add custom admin theme
        wp_admin_css_color($key, $opts['name'], $opts['url'], $opts['colors'], $opts['icons']);
    }
public function addAdminTheme ( $ key , $ args ) { // Check args if ( empty ( $ args ) ) { return ; } $ defaults = [ 'name' => $ key , 'url' => $ key , 'colors' => [ ] , 'icons' => [ ] ] ; // Create options with args $ opts = array_merge ( $ defaults , $ args ) ; // Check options if ( ! isset ( $ opts [ 'name' ] , $ opts [ 'url' ] , $ opts [ 'colors' ] ) ) { return ; } // Works on colors if ( 3 > count ( $ opts [ 'colors' ] ) ) { $ opts [ 'colors' ] [ 1 ] = isset ( $ opts [ 'colors' ] [ 1 ] ) ? $ opts [ 'colors' ] [ 1 ] : $ opts [ 'colors' ] [ 0 ] ; $ opts [ 'colors' ] [ 2 ] = isset ( $ opts [ 'colors' ] [ 2 ] ) ? $ opts [ 'colors' ] [ 2 ] : $ opts [ 'colors' ] [ 1 ] ; } // Works on icons if ( isset ( $ opts [ 'icons' ] ) ) { $ opts [ 'icons' ] = [ 'base' => isset ( $ opts [ 'icons' ] [ 'base' ] ) ? $ opts [ 'icons' ] [ 'base' ] : $ opts [ 'colors' ] [ 0 ] , 'focus' => isset ( $ opts [ 'icons' ] [ 'focus' ] ) ? $ opts [ 'icons' ] [ 'focus' ] : $ opts [ 'colors' ] [ 1 ] , 'current' => isset ( $ opts [ 'icons' ] [ 'current' ] ) ? $ opts [ 'icons' ] [ 'current' ] : $ opts [ 'colors' ] [ 2 ] , ] ; } else { $ opts [ 'icons' ] = [ 'base' => $ opts [ 'colors' ] [ 0 ] , 'focus' => $ opts [ 'colors' ] [ 1 ] , 'current' => $ opts [ 'colors' ] [ 2 ] , ] ; } // Add custom admin theme wp_admin_css_color ( $ key , $ opts [ 'name' ] , $ opts [ 'url' ] , $ opts [ 'colors' ] , $ opts [ 'icons' ] ) ; }
Add admin theme.

@param string $key
@param array  $args
Add admin theme .