How to add custom meta box under Gallery Settings in the “Edit Gallery” popup
How to add custom meta box under Gallery Settings in the “Edit Gallery” popup
How to add custom meta box under Gallery Settings in the “Edit Gallery” popup
It’s not a pretty solution but I used the post__in attribute for this once in a custom plugin. Basically you usually define an array of attachment id’s to show in the media library. library: { type: ‘image’, post__in:[23,25,26] // or a javascript variable that contained the array of id’s } My code was originally built … Read more
I found this great tutorial for adding/filtering fields. However, do you think it is ideal remove core functionality? I suggest hiding the fields with css that you do not want displayed, and creating a field for Source rather than modifying it. The reason for this is so that other devs or plugins can utilize the … Read more
Suggested image dimensions Gutenberg Hook
Display attachments by the ID of the post being edited in the wp.media frame (frontend)
‘media_send_to_editor works fine in WordPress 3.5. I did not test the above code but you don’t need to preg_match for .pdf when WordPress supports post_mime_type == ‘application/pdf; This should work better: https://gist.github.com/2176359 Just change the HTML parameters to your needs. I also advise to embed it directly as an <iframe>, native .pdf iframe browser support … Read more
firstly, don’t edit core files of WordPress or your changes will be erased at the next update. in the file options.php look below this array declaration, you have this line : $whitelist_options = apply_filters( ‘whitelist_options’, $whitelist_options ); that means that you can custom this array with this code in a plugin or the theme : … Read more
You can register a new image size by using add_image_size() add_image_size( string $name, int $width, int $height, bool|array $crop = false ) Parameters $name (string) (Required) Image size identifier. $width (int) (Required) Image width in pixels. $height (int) (Required) Image height in pixels. $crop (bool|array) (Optional) Whether to crop images to specified width and height … Read more
You can use remove_image_size() to remove previously registered image sizes. Ex : <?php remove_image_size(‘full-width-image-gallery’); ?> Note: Cannot be used on reserved image size names
The default media box has hard coded HTML values so in order to alter the CSS for it you you have 2 options. Enqueue your own CSS and override the values Disable media-views.css completely and load a custom stylesheet. To enqueue your own style: function blah_admin_css() { wp_enqueue_style( ‘blah_admin_css’, path to your custom.css ); } … Read more