Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

143
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda