themeum / kirki

Extending the customizer
https://kirki.org
MIT License
1.26k stars 328 forks source link

Category dropdown - empty option as first/default? #1714

Closed AlxMedia closed 6 years ago

AlxMedia commented 6 years ago

Issue description:

This is my final issue that I have :-) I'm listing all categories just fine, but it auto picks a category rather than leaving it empty. How would I do to instead have an empty "Select your category" text as default/first selectable item in the list?

How it looks by default now: https://i.imgur.com/UHME1xd.png

aristath commented 6 years ago

Closing as a duplicate of #1593 I was actually working on this one just now, trying to get it in 3.0.21 and add a placeholder argument. As soon as I have a fix I'll post an update on that ticket.

AlxMedia commented 6 years ago

Perfect, thank you.

aristath commented 6 years ago

Fixed in the develop branch, see the other post for example. This will be included in v3.0.21 which will be released in a few days, I'm waiting for a user to test the code fields first 👍

AlxMedia commented 6 years ago

I'm going to test the code field a bit. One thing I noticed right away is that description doesn't work for it, perhaps it's meant not to?

aristath commented 6 years ago

That's weird... I can see the description just fine with the code from the example file: https://github.com/aristath/kirki/blob/0e78c941fd8d8abf6c57d5f567eab3da44f83b9a/example.php#L136-L149

screenshot at dec 16 16-25-19
AlxMedia commented 6 years ago

Here is the code I'm testing, maybe I'm blind or I've made a typo somewhere...

// Styling: Custom CSS
Kirki::add_field( 'alx_flexwall', array(
    'type'          => 'code',
    'settings'      => 'custom-css',
    'label'         => esc_attr__( 'Custom CSS', 'flexwall' ),
    'description'   => esc_attr__( 'Write your own custom CSS for the theme', 'flexwall' ),
    'section'       => 'styling',
    'default'       => '',
    'choices'     => array(
        'language' => 'css',
    ),
) );

https://screenshots.firefoxusercontent.com/images/321dddc6-221b-4ef5-be12-c80aea3681ad.png

aristath commented 6 years ago

meh I still can't replicate 🤷‍♂️

AlxMedia commented 6 years ago

Weird, oh well - not a big deal. Must be something on my end. Running latest WP version?

aristath commented 6 years ago

of course :)

AlxMedia commented 6 years ago

Good good :-)

Did you see my note by the way, regarding the fontawesome dropdown not working within a repeater. A hard thing to fix? Edit: Gotta go for a while, back in a bit!