Support

Account

Home Forums Backend Issues (wp-admin) Sort asc/desc a slect field in backend

Solved

Sort asc/desc a slect field in backend

  • Hello,
    is there a way to sort ASC/DESC a “select field” in the backend?

    I have a select choice list like this

    Black Hairstreak
    Duke of Burgundy
    Brimstone
    Cryptic Wood White
    Brown Argus
    Brown Hairstreak
    Chalk Hill Blue
    Essex Skipper
    Chequered Skipper
    Adonis Blue
    Comma
    Common Blue
    Dark Green Fritillary
    Dingy Skipper
    Clouded Yellow

    and I would like to show the choice list on the backend like this (ASC)

    Adonis Blue
    Black Hairstreak
    Brimstone
    Brown Argus
    Brown Hairstreak
    Chalk Hill Blue
    Chequered Skipper
    Clouded Yellow
    Comma
    Common Blue
    Cryptic Wood White
    Dark Green Fritillary
    Dingy Skipper
    Duke of Burgundy
    Essex Skipper

    The main issue here, is that list is not complete and I will have to add some choices in the futur.

    Best Regards
    Nexus

  • You need to use an acf/prepare_field filter and sort $field['choices']

  • Thanks @hube2 !! That save my day 🙂

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.