Tag Info

New answers tagged

0

I'm not sure if this is exactly what you're looking for, but you might want to check out: get_attached_media() and wp_get_attachment_url().


0

I've used the code linked to below for just such a requirement. https://gist.github.com/seedprod/1367237 Doing this, you don't create a new image size every time you upload a file via the Media Editor, but only when necessary. So essentially, you just go in and add the call to resize the image "on the fly" in your templates where needed. So you'd add that ...


0

This isn't the most elegant answer... but it works! The 'WyPiekacz' plugin, although cool, has not been updated in three years. add_action('transition_post_status', 'check_featured_image_size_after_save', 10, 3); function check_featured_image_size_after_save($new_status, $old_status, $post){ $run_on_statuses = array('publish', 'pending', 'future'); ...


10

The default This is how the favicon (.ico) files show up in the Media Grid view: This is the corresponding part of the micro template: <# } else if ( 'image' === data.type && data.sizes ) { #> <div class="centered"> <img src="{{ data.size.url }}" draggable="false" alt="" /> </div> <# } else { #> ...


0

I guess you copied that code from somewhere. Just from reading through it, I don't see wppf_gallery_ids set anywhere aside from the init function, which means that it can't update anything as the check is empty. I see two options: Either update it during selection within the select function, or just push wppf_new_ids into the wppf_gallery_ids array. To me ...


0

Try this: function rearrange_media_tabs($_default_tabs) { $_default_tabs = array( 'custom' => __('Your Tab Name'), 'type_url' => __('From URL') ); return $_default_tabs; } add_filter( 'media_upload_tabs', 'rearrange_media_tabs' ); From the Codex: https://developer.wordpress.org/reference/functions/media_upload_tabs/


1

I've solved it: var frame = wp.media({ button : { text : 'Wählen' }, frame: 'post'/*, state : 'insert-image',//gallery-edit states : [ new insertImage() ], library : { type : 'image'}*/ });



Top 50 recent answers are included