Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

144
Visualizações
WordPress media library with metadata limit

I want to create a media library window. attachment should filter with mime types and metadata. the mime-type filter is done. How can I build a metadata filter just for this?

function upload_image_tinymce(e) {
    e.preventDefault();
    var $input_field = $('.mce-my_input_image');
    var custom_uploader = wp.media.frames.file_frame = wp.media({
        title: 'Add Video',
        button: {
            text: 'Add Video'
        },
        library: {
            type: [
                'video/MP4',
                'video/quicktime',
                'video/x-m4v',
            ],
        },
        multiple: false
    });
    custom_uploader.on('select', function() {
        var attachment = custom_uploader.state().get('selection').first().toJSON();
        $input_field.val(attachment.id);
    });
    custom_uploader.open();
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I cant help you with the whole filter code (not enoth knowlage ...) But you can use the hook wp_get_attachment_metadata('attachment id') to get an array with the whole metadata of the attachment.

$meta = wp_get_attachment_metadata(126);

Will produce an array with the metadata from the attachment 126.

$cam = $meta[camera]

$cam will then hold the camera string from the metadata ...

Not much but maybe it will lead you a little bit in the right direction.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda