Allow author to upload image via Media button without plugin

in the basic configuration the user role contributor and subscriber do not have the capability upload_files. The user role author has this capability. The capability upload_files gives the user the panels “Media” and “Media > Add New”. If you want another role to grant this capability, you can use the function add_cap(). Since such changes … Read more

How to modify images during upload

You need to use attachment_fields_to_save filter. There is nice example on codex. So instead of copying that here, I would rather like to point you towards the codex page. Please take a look here. I hope this helps.

Don’t show avatars in media library

Like most page loads in WordPress, WP_Query is intimately involved meaning pre_get_posts is your friend. Proof of concept: function step_2($qry) { $qry->set(‘post__not_in’,array(468,303)); } function step_1() { add_action(‘pre_get_posts’,’step_2′); } add_action(‘load-upload.php’,’step_1′); I’m using the load-upload.php hook to isolate the filter to the “Library” page. If you’ve changed the uploads folder for your avatars you’ve already got some … Read more

Uploaded image doesn’t show up in media library

The missing element that makes a file appear in the media library is the attachment post. Attachment posts hold the file metadata, and are what get associated to posts via the post_parent when a file is “attached”. Instead of wp_handle_upload, you can use the function media_handle_upload, which will handle the file upload as well as … Read more

Renaming “Expand Details” within “Add Media”

It’s possible to change the output of the label with jQuery but I’m not sure the best hook to do this besides admin_footer. // Collapse var $open = jQuery(‘.acf-expand-details > .is-open’), $open_icon = $open.find(‘span’); $open.html(‘MIN Details –>’); $open.prepend($open_icon); // Expand var $close = jQuery(‘.acf-expand-details > .is-closed’), $close_icon = $close.find(‘span’); $close.html(‘<– MAX Details’); $close.prepend($close_icon); add_action( ‘admin_enqueue_scripts’, … Read more

Password protected uploaded PDF page

Try using the Advanced Custom Fields plugin: http://www.advancedcustomfields.com/ You can add a file(s) upload field to your “designs” post type, and hide the regular content editor. Then you can create a custom template for that post type that displays the files attached to the post.