Uploading non-media files?

There are two ways that error can be triggered ( source ): user does not have unfiltered_upload capability; WP does not like file type or extension. Latter is checked by wp_check_filetype_and_ext() function ( source ) that filters return through wp_check_filetype_and_ext hook to allow validation of additional file types.

Pagination not working on static page

Dear I have wasted my week on this problem, basically when you select static page as your home page in setting->reading of wordpress the complete behavior of listing things are changed, basically static pages are never meant for pagination the fact is when you call the $paged variable it will always return zero even if … Read more

Post Specific Uploader

Check if the argument is present, and if it isn’t return the default value: if(!isset($_REQUEST[‘post_id’])) return $upload; // cast it to integer to avoid problems $id = (int)$_REQUEST[‘post_id’]; …

Creating a Lightweight Media Tags Plugin with a Custom Taxonomy

Sadly, I haven’t found the flaw in your code as far as update counts. Copy and paste mine for comparison (stick it in a plugin you can easily deactivate). This works like a charm, with all counts updating correctly: class ZGAttachmentTags { const SLUG = ‘attachment-tags’; function __construct() { add_action( ‘init’, array( $this, ‘register_custom_taxonomy’ ) … Read more

Run script after clicking Set Featured Image in Media

I think what you need is (function(){ var featuredImage = wp.media.featuredImage.frame(); featuredImage.on(‘select’, function(){ var attachment = featuredImage.state().get(‘selection’).first().toJSON(); console.log(attachment); }); })(); The attachment object should have height and width properties.