attachment media-template data model (data.size.url)

Problem fixed: I was not sending all properties (and didn’t find a list of possible properties) that the media_template expects. Finally I ended up alerting the data object by doing this (last 6 lines), where I first checked out ‘data’, and then each [object, object] that was returned (such as data.size) <script type=”text/html” id=”tmpl-attachment”> <div … Read more

WordPress Media Library showing wrong preview size?

It’s actually a feature, not a bug! 🙂 WordPress will use (actually image_get_intermediate_size() function) a image already cropped if the width or the height matches the required dimension, and the required dimenssion for image editor is 900×450, EXACTLY your defined width. A workaround will be to adjust your custom image size to 205 x 499 … Read more

Media Manager (since 3.5): How to show an empty Media Library when creating a media frame?

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

Choosing images size when uploading

For trivia WP will generate all registered sizes for every image natively. While this doesn’t quite seem optimal, the recommendation (if one might call it that) to deal with it is “get bigger disks”. 🙂 If size isn’t a concern you can just go with it. The typical solution takes a little different angle. Instead … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)