Hi Raz,
First, i'd like to say a big thank you for your work on this class, it will give me a good help in my next project.
I've played with it tonight, and as i like to use external urls for my images, i've noticed that you only save an image meta if an attachment id is provided.. In my case, there's not, so the image is not saved in tax meta :(
Suggestion to make it work for external urls
So i've edited your javascript file tax-meta-clss.js
inserting these lines after line 311 :
else if( val.indexOf("wp-image") == -1 && load_images_muploader_check_is_image( imgurl ) ) {
// it's an external url image
att_id = 0;
return true;
}
Then i inserted my quick and dirty load_images_muploader_check_is_image
function elsewhere up in the file to check that the url is leading to an image file (as it's possible to link to other media file.
function load_images_muploader_check_is_image( image ) {
var isimage = false;
if( image.substring(image.length -4).indexOf('.jpg') != -1 )
isimage = true;
else if( image.substring(image.length -4).indexOf('jpeg') != -1 )
isimage = true;
else if( image.substring(image.length -4).indexOf('.png') != -1 )
isimage = true;
else if( image.substring(image.length -4).indexOf('.gif') != -1 )
isimage = true;
return isimage;
}
That fixed my issue, it seems my edits didn't break everything, but i guess it needs testing..
Suggestion about tax meta updates
Finally i have a suggestion to make about data insertion in db. I've tried to add a simple javascript in a text field and then echoed it on front.. And it popped. So even if i don't imagine an admin doing such tests on their sites, i simply advise you to add a filter just before saving the meta in your update_tax_meta functions. For example :
$m[$key] = apply_filters( 'tax_meta_class_update_meta', $value );
Then admins will be able to eventually sanitize the inputs by adding this kind of filter :
function tax_meta_class_update_meta_filter( $meta ) {
return wp_kses( $meta, array() );
}
add_filter('tax_meta_class_update_meta', 'tax_meta_class_update_meta_filter', 10, 1 );
Again, thanks for the great work and best wishes (we'll soon be in 2013 ;) )