file_advanced: search option for wp media popup

Support General file_advanced: search option for wp media popup

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #8608
    mundeeemundeee
    Participant

    hi,

    is there a simple way or workaround to automatically prefill the search box (and start search) in the media library after I click the "add" button in a file_advanced field?

    I can set a mime_type which is a great help already, but a customer is afraid he can't handle his several hundred files without prefiltering by filename.
    e.g. file_advanced field for 'manual' -> filter the media library, show only files with manual in filename

    do I need to create a custom field type with it's own js for wp.media, or is there an easier solution?

    #8609
    mundeeemundeee
    Participant

    already got a quick&dirty way to do it:
    $('#media-search-input').val('manual').trigger({type: 'keyup'});

    but still hoping to find a more solid solution, in case someone can give me a hint 🙂

    #8612
    Anh TranAnh Tran
    Keymaster

    Hello, I think your trick is the best way to handle that. Because the whole media popup is WP thing, we’re limited by its ability. Until now, I haven’t found a way to auto search like that.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘file_advanced: search option for wp media popup’ is closed to new replies.