Tag Info

Hot answers tagged

2

640px is the content size set in your functions.php. Here is an example of the content width set in the bundled theme twentyfourteen in twentyfourteen/functions.php#L28 if ( ! isset( $content_width ) ) { $content_width = 474; } In this example, the image size will be 474 px. The content size will be the size used when images are inserted as ...


1

Have you tried to use get_children() function? Edit: All media attached to any post is treated as children of it. The function wp_get_attachment_image() will only return images. With the function get_children() you'll be able to get all the media, images or anything else. In the above link, you can find some examples.


1

wordpress sucks in keeping media<=>content relationships. Part of the problem is that by default all media are public once they are uploaded and you have no way to know where are they are being used. Just because an image is not referenced anymore in its original post doesn't mean that it is not referenced at any other place (sidebar widget?) or maybe by ...


1

The answer is there is no damn hook for the edit button. It's just a bunch of JS contained within wp-includes/js/tinymce/plugins/wpeditimage/plugin.js. I've included the barebones of what you need below. Key points: a. Clicking an element with a data-wp-imgselect attribute will open the image edit dialogue. You need to change that to something else if you ...


1

You just have to call destroy method on the attachment model. This will both remove the attachment from the Media Library view, and send an ajax call to the backend to delete the attachment in the database and all linked files in uploads directory. You do not need to convert the attachment to JSON to get the id : you can directly manipulate the Backbone ...


1

Attempting a somewhat canonical (or at least bountiful) answer, this is the javascript for wpse142997.js in the child template directory: jQuery( document ).ready(function() { ( function( $ ) { var media = wp.media, l10n = media.view.l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n, attachments = ...



Only top voted, non community-wiki answers of a minimum length are eligible