Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define Media MIME Type #48

Open
saddam-azad opened this issue Jul 13, 2012 · 0 comments
Open

Define Media MIME Type #48

saddam-azad opened this issue Jul 13, 2012 · 0 comments

Comments

@saddam-azad
Copy link

Currently, you can enter an audio file into an image field because there is no way to validate whether the input is of the correct MIME Type.

Perhaps, it would be best to be able to define the input type in the code. I want users to enter just images (and not audio/video) into this field:

<?php $mb->the_field('imgurl'); ?>
<?php $mediaAccess->setGroupName('imagepost')->setInsertButtonLabel('Insert'); ?>

<p>
<?php echo $mediaAccess->getField(array(
        'name' => $mb->get_the_name(),
        'value' => $mb->get_the_value()));
 ?>     

<?php echo $mediaAccess->getButton(array('label' => 'Add Image from Library')); ?>
</p>

Maybe it is possible to leverage the post_mime_type filter of the Wordpress Media Library.

Also, would it be able to acquire the corresponding information for the file (alt, title, description)?

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant