Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

147
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!