Skip to content

Color picker

A color, chosen with the color picker of WordPress, such as the accent color of a theme.

In the editor

A color picker in the editor, with its default color

Besides the settings every field shares, a color picker has:

Setting What it does
Default color (HEX) The color the option gets when you save the menu, as long as it has no value yet, such as #0e7490.

On the options page

The color picker on the options page, with a teal color chosen

Click Select Color to open the picker, or type a hex color.

The value

Stores a hex color with a #, such as #0e7490. A value that is not a hex color is refused: the options page says so, and the previous color is kept.

On your website

printf( '<style>:root { --accent: %s; }</style>', esc_attr( get_option( 'accent_color', '#0e7490' ) ) );
[aop_option name="accent_color"]