__get_material_colors

A utility method that retrieves a collection of material colors.

REMINDER

The __get_material_colors() is a public static method of Handy class. When using this static method, remember to apply the Scope Resolution Operator (::).

Parameters

NameDescription
$type

string optional

The type or name of material color. Accpets only primary, a100, a200, a400, a700, red, pink, purple, deepPurple, indigo, lightBlue, lime, yellow, amber, orange, deepOrange, brown, grey and blueGrey.

Basic Usage

REMINDER

In this example, the select control's choices parameter will be supplied with __get_material_colors().

 
// Select Control.
Handy::control( 'select', [
    'id'          => 'select_id',
    'section'     => 'layout_section',
    'label'       => esc_html__( 'Select Control', 'textdomain' ),
    'priority'    => 1,
    'choices'     => Handy::__get_material_colors( 'primary' )
]);

Return

TypeValue
array [ 'color1', 'color2', … ]