When to use it. One icon from a set: a service icon, a social network, a feature.
What the editor sees. A grid of icons with a search box.

| Name in files and code | icon_picker |
ugly_get() gives |
The file name, the URL or [ 'name', 'url', 'kind' ]. |
| Behavior | can be required; can share a line with other fields |
Settings
| Setting | What it does | Default |
|---|---|---|
| Where the icons come from | folder |
|
| Folder inside the theme | For example assets/icons. Every .svg, .png and .webp file in it is offered. | assets/icons |
| What the code receives | Choices: {'value': 'value', 'label': 'The name (file name or dashicon class)'}, {'value': 'url', 'label': 'The address of the file (folder icons)'}, {'value': 'array', 'label': 'A list: name, address and kind'}. |
value |
In your theme
$icon = ugly_get( 'icon' ); // return format: array
if ( $icon ) : ?>
<img src="<?php echo esc_url( $icon['url'] ); ?>" alt="" width="32" height="32">
<?php endif;Good to know
- Where the icons come from: the Dashicons of WordPress, or a folder of your theme with SVG files.
- With What the code receives set to
valueyou get the name or file, withurlthe address, witharrayboth and its kind.